Skip to content

Instantly share code, notes, and snippets.

@igeligel
Last active June 17, 2019 10:34
Show Gist options
  • Save igeligel/d6923cf418f1ea9f3ad158df3749c413 to your computer and use it in GitHub Desktop.
Save igeligel/d6923cf418f1ea9f3ad158df3749c413 to your computer and use it in GitHub Desktop.
SELECT *,
CASE
WHEN name = ANY(ARRAY['Airbus A333-300', 'Airbus A380-800']) THEN 'airplane'
WHEN name = ANY(ARRAY['Volkswagen Golf', 'Porsche Cayenne']) THEN 'car'
ELSE null
END AS type
FROM vehicles;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment