问题
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