-
-
Save linxlad/f6ff5ae71ab2b58d429ece69d2ce1eaa to your computer and use it in GitHub Desktop.
PostgreSQL: Concat two strings intelligently
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 CONCAT( | |
first_name, | |
(CASE WHEN (first_name IS NULL OR first_name = '') THEN '' ELSE ', ' END), | |
last_name | |
) FROM members |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment