Skip to content

Instantly share code, notes, and snippets.

@thomasklemm
Created June 9, 2015 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasklemm/be5435eac637fc0f5a32 to your computer and use it in GitHub Desktop.
Save thomasklemm/be5435eac637fc0f5a32 to your computer and use it in GitHub Desktop.
Postgres SET using a CASE statement
UPDATE media_images
SET collectively_manage_publication_for_all_locales = (
CASE
WHEN ((published_de = published_en) AND (published_from_de = published_from_en))
THEN TRUE
ELSE FALSE
END
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment