Created
January 17, 2019 12:33
-
-
Save andyp14feb/8072dda442d53d9cf3186876fcbd4f4f to your computer and use it in GitHub Desktop.
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 | |
e1.name | |
FROM | |
employees e1 | |
LEFT JOIN( | |
SELECT DISTINCT | |
managerid | |
FROM | |
employees | |
WHERE | |
managerid IS NOT NULL | |
)e2 ON e2.managerid = e1.id | |
WHERE | |
e2.managerid IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment