Skip to content

Instantly share code, notes, and snippets.

@benfalk
Created June 30, 2016 20:14
Show Gist options
  • Save benfalk/d58924dcc11c7692889b2e465093c2b1 to your computer and use it in GitHub Desktop.
Save benfalk/d58924dcc11c7692889b2e465093c2b1 to your computer and use it in GitHub Desktop.
WITH vals AS (
SELECT * FROM(VALUES
('t'::boolean),
(NULL),
('f'::boolean),
('t'::boolean),
(NULL),
('f'::boolean)
) AS map(val)
)
SELECT *
FROM vals
ORDER BY val DESC NULLS LAST;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment