mysql使用常见错误
时间:2010-10-16 来源:李湛斌
1.大小写的问题
create table book(
ISBN varchar(10) not null,
name varchar(30) not null,
price DOUBLE not null,
author varchar(30) not null,
publisherID varchar(30) not null,
primary key (ISBN)
)
上面的sql语句看起来没有问题,但是执行起来是错误的,为什么呢?因为not null没有大写
这样写才正确
create table book(
ISBN varchar(10) NOT NULL,
name varchar(30) NOT NULL,
price DOUBLE NOT NULL,
author varchar(30) NOT NULL,
publisherID varchar(30) NOT NULL,
primary key (ISBN)
)
相关阅读 更多 +
排行榜 更多 +