MySql提示Column count doesn't match value count at row 1
2015-05-05 13:16
477 查看
转自:http://blog.163.com/yaxctgu@126/blog/static/1626703182010111444728673/
今天在将sql server语句改成MySQL语句时报错:Column count doesn't match value count at row 1,讲的是表的列数与你插入的数据列数不匹配。
commputerroom表总共五列,每列都不许为空,第一列为自增长的,现向该表中插入数据:INSERT INTO computerroom VALUES('ddd',9,12,108);
结果报错:[SQL] INSERT INTO computerroom VALUES('ddd',9,12,108);[Err] 1136 - Column count doesn't match value count at row 1
但是改成:INSERT INTO computerroom VALUES(3,'ddd',9,12,108);即把自增长列指定值,却又可以!这下把我给搞晕了,查看了表的结构也是自增长的啊,那是什么问题呢?后来回到最原始的写法,指定列名,INSERT INTO computerroom(name,rowscount,columnscount,total)
VALUES('ddd',9,12,108);一执行,ok了,竟然成功了!把上面语句拿到sql server中去执行却是能够成功执行的!原来mysql 跟sql server在这个语句的处理上是有区别的!大家写的时候千万别忘了,免得再去为这个问题而纠结!
今天在将sql server语句改成MySQL语句时报错:Column count doesn't match value count at row 1,讲的是表的列数与你插入的数据列数不匹配。
commputerroom表总共五列,每列都不许为空,第一列为自增长的,现向该表中插入数据:INSERT INTO computerroom VALUES('ddd',9,12,108);
结果报错:[SQL] INSERT INTO computerroom VALUES('ddd',9,12,108);[Err] 1136 - Column count doesn't match value count at row 1
但是改成:INSERT INTO computerroom VALUES(3,'ddd',9,12,108);即把自增长列指定值,却又可以!这下把我给搞晕了,查看了表的结构也是自增长的啊,那是什么问题呢?后来回到最原始的写法,指定列名,INSERT INTO computerroom(name,rowscount,columnscount,total)
VALUES('ddd',9,12,108);一执行,ok了,竟然成功了!把上面语句拿到sql server中去执行却是能够成功执行的!原来mysql 跟sql server在这个语句的处理上是有区别的!大家写的时候千万别忘了,免得再去为这个问题而纠结!
相关文章推荐
- mysql提示Column count doesn't match value count at row 1错误
- Mysql提示Column count doesn't match value count at row 1
- mysql提示Column count doesn't match value count at row 1错误
- mysql提示Column count doesn't match value count at row 1错误
- 错误提示: Column count doesn't match value count at row 1
- mysql 1136错误 Column count doesn't match value count at row 1
- mysql错误:Column count doesn't match value count at row 1
- MySQL报错: java.sql.SQLException: Column count doesn't match value count at row 1
- MySQL错误:Column count doesn't match value count at row 1
- sqlexception:Column count doesn't match value count at row 1 Query
- java.sql.SQLException:Column count doesn't match value count at row 1
- 数据库新增出现错误代码: 1136 Column count doesn't match value count at row 1
- Column count doesn't match value count at row 1
- 问题:java.sql.SQLException: Column count doesn't match value count at row 1
- Mysql报错:Column count doesn't match value count at row 1
- java.sql.SQLException:Column count doesn't match value count at row 1
- 执行Mysql提示"Column count doesn't match value count at row 1"错误
- Column count doesn't match value count at row 1
- 错误:Column count doesn't match value count at row 1
- Column count doesn't match value count at row 1问题解决