Skip to content

Instantly share code, notes, and snippets.

@yalla
Created September 28, 2011 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yalla/a8841731cb9aa5d8aa26 to your computer and use it in GitHub Desktop.
Save yalla/a8841731cb9aa5d8aa26 to your computer and use it in GitHub Desktop.
stackoverflow.com 960800 - Update query
UPDATE `profiles`
SET `name` = CASE `id`
WHEN 1 THEN 'John'
WHEN 2 THEN 'Jane'
END, `gender` = CASE `id`
WHEN 1 THEN 'Male'
WHEN 2 THEN 'Female'
END
WHERE `id`=1 OR `id`=2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment