【MySql】Column count doesn't match value count at row 1 解决方法
2015-06-10 16:43
465 查看
Column count doesn't match value count at row 1 解决方法
这是因为sql语句多插入了一个值,和表里并不匹配造成的set @execSql = concat('insert into REP_CLICK_COUNT(data_time,release_count,forum_count,h5_count,add_count,admin_forum_count,insert_time)', ' values(\'1\',\'',dataTime,'\',\'',@releaseCount,'\',\'',@forumCount,'\',\'',@h5Count,'\',\'',@addCount,'\',\'',@adminforumCount,'\',now())'); #SELECT @execSql; prepare stmt from @execSql; execute stmt;
如上:
很明显插入语句多了一个 \'1\ ' 的值并没有对应的字段。所以改成
set @execSql = concat('insert into REP_CLICK_COUNT(<span style="color:#FF0000;">data_type</span>,data_time,release_count,forum_count,h5_count,add_count,admin_forum_count,insert_time)', ' values(\'1\',\'',dataTime,'\',\'',@releaseCount,'\',\'',@forumCount,'\',\'',@h5Count,'\',\'',@addCount,'\',\'',@adminforumCount,'\',now())'); #SELECT @execSql; prepare stmt from @execSql; execute stmt;
问题解决!
相关文章推荐
- UVA11995:I Can Guess the Data Structure
- 得到UIImage的方法
- iOS UITableView的Section Footer添加按钮
- iOS UITableView的Section Footer添加按钮
- Android Bluetooth开发
- 详细解析BluetoothAdapter的详细api
- GRE的issue写作要求
- 在storyboard中的静态UITableView中拖入 UISearchBar and Search Display Controller出现的奇怪问题
- request response 编码设置
- IOS开发—UITableViewCell的四种类型
- rust map的使用:获取某个key对应的value,如果不存在就插入一个
- message queue & event loop
- Bluemix云平台实践:使用Bluemix Labs Catalog来创建应用(2)
- Uva - 133 - The Dole Queue
- Uva - 133 - The Dole Queue
- oem 启动报错 OC4J Configuration issue. notfound
- Build 2015 Beijing & Windows 10 China Geek Challenge
- UIAutomator在AndroidStudio中的使用
- UIView 实现反转效果
- 自定义UI控件实现跑马灯效果