Skip to content

Instantly share code, notes, and snippets.

@michaelaguiar
Created September 18, 2013 23:35
Show Gist options
  • Save michaelaguiar/6617257 to your computer and use it in GitHub Desktop.
Save michaelaguiar/6617257 to your computer and use it in GitHub Desktop.
Case statement for MySQL
UPDATE TBL_NAME SET COL_NAME = (CASE WHEN (COL_NAME = 0) THEN 1 ELSE 0 end);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment