在mysql(版本:5.0.18-nt)上运行以下语句报错Create table ever_user
(
Uid char(40) not null,
Pwd char(40) not null,
Info char(100) not null,
Eassy int not null,
Totaltime char(14) not null,
Reads int not null,
If_new_info int not null,
Constraint pk_ever_user primary key (Uid)
);
错误信息:
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 'Reads
 int not null,
If_new_info int not null,
Constraint pk_ever_user primary ke' at line 8本人英文不太好,是语法错误,但是我又找不到哪里错了!
请教各位大虾!先谢谢了
问题补充:在MSSQLserver(版本:8.00.2039)上可以正确建表运行没有任何错误,更郁闷了!
另外三段sql语句能够正确运行,语句如下:
Create table currentuser
(
Num int not null,
Uid char(40) not null,
Lastlogon char(14) not null,
serialNum int not null,
constraint pk_currentuser primary key (num)
)Create table detail
(
Uid char(40) not null,
Levels int not null,
Visits int not null,
Dataandtime char(14)not null,
Length int not null,
Content char(100) not null,
Constraint pk_detail primary key (uid)
)Create table new_essay
(
Fieldid char(40) not null,
Theme char(100) not null,
Dataandtime char(14)not null,
Constraint pk_new_essay primary key (Fieldid)
)

解决方案 »

  1.   

    呵呵
    过来了!
    Create table ever_user 

    Uid char(40) not null, 
    Pwd char(40) not null, 
    Info char(100) not null, 
    Eassy int not null, 
    Totaltime char(14) not null,
    Reads_xiaoyu int not null, 
    If_new_info int not null, 
    Constraint pk_ever_user primary key (Uid) 
    ); 这样就过去了,你的Reads字段改了就可以过来了,【reads】保留字!