在mysql中创建了一个表,当想插入数据的时候,一直提示一个错误,望得到解决。
错误为:Columncountdoesn'tmatchvaluecountatrow1创建表的语句如下:createtabledaily(dailynointauto_i...
错误为:Column count doesn't match value count at row 1
创建表的语句如下:
create table daily(
dailyno int auto_increment primary key,
dailyname nvarchar(10) not null,
dailysort nvarchar(20),
userno char(10),
begintime datetime,
overtime datetime,
price decimal(6,2) check(price>0),
dailystate int check(dailystate=0 or dailystate=1)
remarks nvarchar(50),
foreign key(userno) references users(userno)
);
插入数据语句(两条都不好用):
insert into daily (dailyname,dailysort,userno,begintime,overtime,price,dailystate,remarks)
values('早餐','日常','0001','2011-3-25','2011-3-26',11.00,'1111111');
insert into daily values(00001,'早餐','日常','0001','2011-3-25','2011-3-26',11.00,'1111111'); 展开
创建表的语句如下:
create table daily(
dailyno int auto_increment primary key,
dailyname nvarchar(10) not null,
dailysort nvarchar(20),
userno char(10),
begintime datetime,
overtime datetime,
price decimal(6,2) check(price>0),
dailystate int check(dailystate=0 or dailystate=1)
remarks nvarchar(50),
foreign key(userno) references users(userno)
);
插入数据语句(两条都不好用):
insert into daily (dailyname,dailysort,userno,begintime,overtime,price,dailystate,remarks)
values('早餐','日常','0001','2011-3-25','2011-3-26',11.00,'1111111');
insert into daily values(00001,'早餐','日常','0001','2011-3-25','2011-3-26',11.00,'1111111'); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |