Last active
May 18, 2017 19:25
-
-
Save pioh/4305fef42847258f8a0bbb277d75f36f to your computer and use it in GitHub Desktop.
GetFields
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 | |
u.id AS user_id, | |
u.email, | |
p.comment, | |
NULL AS first_name, | |
NULL AS middle_name, | |
NULL AS last_name, | |
NULL AS lang | |
FROM nirhub.user AS u | |
LEFT JOIN nirhub.person AS p | |
ON u.id = p.user_id | |
WHERE u.id IN ('110c11602000401', '110c1278a800403') | |
UNION | |
SELECT | |
p18.user_id, | |
NULL, | |
NULL, | |
p18.first_name, | |
p18.middle_name, | |
p18.last_name, | |
p18.lang | |
FROM nirhub.person_i18n AS p18 | |
WHERE p18.lang IN ('ru_RU', 'en_US', 'de_DE') | |
AND p18.user_id IN ('110c11602000401', '110c1278a800403') | |
ORDER BY user_id; |
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
+-----------------+----------------------+-----------+----------------+----------------+---------------+--------+ | |
| user_id | email | comment | first_name | middle_name | last_name | lang | | |
|-----------------+----------------------+-----------+----------------+----------------+---------------+--------| | |
| 110c11602000401 | [email protected] | коммент | <null> | <null> | <null> | <null> | | |
| 110c11602000401 | <null> | <null> | ЧебурашкаDE | ЧебурашкаDE | ЧебурашкаDE | de_DE | | |
| 110c11602000401 | <null> | <null> | Чебурашка | Чебурашка | Чебурашка | ru_RU | | |
| 110c11602000401 | <null> | <null> | Чебурашкаen_US | Чебурашкаen_US | Чебурашкen_US | en_US | | |
| 110c1278a800403 | [email protected] | коммент | <null> | <null> | <null> | <null> | | |
| 110c1278a800403 | <null> | <null> | Мурзенок | <null> | Сергей | ru_RU | | |
+-----------------+----------------------+-----------+----------------+----------------+---------------+--------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment