Skip to content

Instantly share code, notes, and snippets.

@uberboom
Created July 15, 2016 06:24
Show Gist options
  • Save uberboom/7c84c7a6acb41ef3af12cb2666e66ce7 to your computer and use it in GitHub Desktop.
Save uberboom/7c84c7a6acb41ef3af12cb2666e66ce7 to your computer and use it in GitHub Desktop.
MySQL 5.7: Convert “zero dates” to null
update `mytable`
set `created` = null
where cast(`created` as char(20)) = '0000-00-00 00:00:00';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment