Last active
June 17, 2019 10:34
-
-
Save igeligel/da7de5eeec77821eed7371fc62910d53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT SUM(price), | |
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 | |
GROUP BY vehicle_type; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment