Created
March 16, 2018 13:10
-
-
Save imsarvesh/0c72f29ab5d521d311e834cd75851add to your computer and use it in GitHub Desktop.
This file contains 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 | |
CASE | |
WHEN u.first_name IS NULL AND u.last_name IS NULL THEN u.username | |
WHEN u.first_name = '' AND u.last_name = '' THEN u.username | |
ELSE u.first_name || ' ' || u.last_name | |
END as "name" | |
FROM users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment