doujingya1166 2014-04-22 09:06
浏览 207
已采纳

正确的语法中,列计数与行错误处的值计数不匹配

I have written an insert query but it throws an error #1136. I checked for comma and other syntax and field with NULL values are Null allowed is also checked. Its not working. I searched for similar questions but didn't help. I have tried it both the way.

1st way:

INSERT INTO postdetails SET
PostId = NULL,
EventId = 1, 
FacultyId = 'hemal.desai',
InstituteId = 1,
PostTitle = 'title',
PostMsg = 'msg',
PostDate = '2014-04-22',
EventDate = '2014-04-30',
PostTime = CURRENT_TIME(),
DeleteDate = '2014-04-30',
Edited = 'No',
FileURL = 'Null',
status = 'upcoming',
reason =NULL,
oldeventdate = NULL;

and the 2nd way:

INSERT INTO postdetails (PostId, EventId, FacultyId, InstituteId, PostTitle, PostMsg, PostDate, EventDate, PostTime, DeleteDate, Edited, FileURL, status, reason, oldeventdate) VALUES (NULL, '1', 'siddhi.shah@ahduni.edu.in', '1', 'Sidddhi Mam', 'Message', '2014-04-22', '2014-04-29', CURRENT_TIME(), '2014-05-03', 'No', 'Null', 'upcoming', NULL, NULL);

My table structure is like this:

enter image description here

Please help me.

  • 写回答

1条回答 默认 最新

  • doushenken2833 2014-04-22 12:15
    关注

    I have replicate the same structure to verify for issue and it working for me with provided insert query without changing anything.

    So as SarjitDelivala suggested, please check for trigger or else provide complete error with table engine detail.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)