MySQL updating nullable date column to NULL

耗尽温柔 提交于 2019-12-12 04:05:58

问题


I have a nullable date column in a MySQL InnoDB table. How do I update that column to NULL when issuing an update?

UPDATE memo_codes_student SET `resolved_date_client` = NULL, `status` = 'Rejected' WHERE `guid_enrollment` = @guid_enrollment AND `guid` = @itemGUID

When I run the statement above, it updates the field to 0000-00-00. How can I get it to update the field to NULL?


回答1:


You are probably running in NO_ZERO_DATE mode.

See this post for more information: https://stackoverflow.com/a/3891947/1602014



来源:https://stackoverflow.com/questions/34859629/mysql-updating-nullable-date-column-to-null

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