Skip to content

Instantly share code, notes, and snippets.

@ilake
Created January 22, 2013 04:23
Show Gist options
  • Select an option

  • Save ilake/4592019 to your computer and use it in GitHub Desktop.

Select an option

Save ilake/4592019 to your computer and use it in GitHub Desktop.
sql UPDATE, SET
execute <<-SQL
UPDATE contacts
SET country =
CASE
WHEN country = 'USA' THEN 'United States'
WHEN country = 'Russia' THEN 'Russian Federation'
WHEN country = 'Virgin Islands' THEN 'Virgin Islands, U.S.'
END
WHERE country in ('USA', 'Russia', 'Virgin Islands')
SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment