Skip to content

Instantly share code, notes, and snippets.

@watershed
Created June 14, 2018 08:54
Show Gist options
  • Save watershed/749ec83bcf58a38c2a29e4dad5800823 to your computer and use it in GitHub Desktop.
Save watershed/749ec83bcf58a38c2a29e4dad5800823 to your computer and use it in GitHub Desktop.
MySQL: update multiple rows for the same column/field
UPDATE table_name
SET field_to_update = CASE id
WHEN n THEN 'Text value'
END
WHERE id IN (n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment