Invalid datetime format: 1292 Truncated incorrect DOUBLE value

元气小坏坏 提交于 2021-01-28 03:02:34

问题


I am fire this sql query and then return this error.

My Error:

1292 Truncated incorrect DOUBLE value: '1,2,3,4,5,6,7,122,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,157,153,154,155,156' The SQL being executed was:

My Query:

DELETE FROM groups_module_actions 
WHERE module_action_id NOT IN('1,2,3,4,5,6,7,122,8,9,10,11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,157,153,154,155,156') AND group_id='1'

回答1:


Skip the quotes in the NOT IN (), its expecting datatype integer not a string.

DELETE FROM groups_module_actions WHERE module_action_id 
NOT IN(1,2,3,4,5,6,7,122,8,9,10,11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,157,153,154,155,156) 
AND group_id=1


来源:https://stackoverflow.com/questions/54290696/invalid-datetime-format-1292-truncated-incorrect-double-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!