首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

mysql中DEFAULT的用法,该怎么处理

2012-08-13 
mysql中DEFAULT的用法mysql CREATE TABLE max(-friend_max int NOT NULL DEFAULT 0,-user_maxint NOT N

mysql中DEFAULT的用法
mysql> CREATE TABLE max(
  -> friend_max int NOT NULL DEFAULT 0,
  -> user_max int NOT NULL DEFAULT 0
  -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'max(
  friend_max int NOT NULL DEFAULT 0,
  user_max int NOT NULL DEFAULT 0
)' at line 1

原因为何,DEFAULT后必须跟'0'这样的字符串么?

[解决办法]
CREATE TABLE `max`(
friend_max int NOT NULL DEFAULT 0,
user_max int NOT NULL DEFAULT 0
);
[解决办法]
保留字加``
`max`
[解决办法]
是1左边的那个符号 不是单引号

热点排行