Last active
April 26, 2019 13:27
-
-
Save clebersonfalk/447db4199b69ef20ba2a1da91d73c671 to your computer and use it in GitHub Desktop.
MySQL - Concat Not Null and Trim Separator on start and in the end
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 | |
TRIM(BOTH ';' FROM CONCAT_WS(';',`u`.`email`,`u`.`other_email`)) as emails, | |
`u`.`nome` | |
FROM | |
desk_20.`users` AS `u` | |
WHERE | |
(u.id_role = 2)# Admins | |
AND (u.status = 1) | |
AND (u.deleted = 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment