Last active
June 30, 2018 17:47
-
-
Save AllenJB/872553b5cb2086b0b8de9b0c50044ce5 to your computer and use it in GitHub Desktop.
MySQL join same table on different fields
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 table1.employee_id_1, table1.employee_id_2, e1.first_name AS e1_first_name, e2.first_name AS e2_first_name | |
FROM table1 | |
LEFT JOIN employee_tbl AS e1 ON table1.employee_id_1 = e1.employee_id | |
LEFT JOIN employee_tbl AS e2 ON table2.employee_id_2 = e2.employee_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment