doujingya1166 2014-04-22 01: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 04: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.

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部