Created
January 27, 2016 09:07
-
-
Save dnasca/48d771a7573b8bb4e774 to your computer and use it in GitHub Desktop.
Self Joins - joining a data source to itself
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 | |
| e.BusinessEntityId, | |
| e.HireDate, | |
| e.ManagerId, | |
| m.HireDate | |
| FROM | |
| HumanResources.Employee AS e | |
| LEFT OUTER JOIN | |
| HumanResources.Employee AS m | |
| ON | |
| e.ManagerId = m.BusinessEntityId; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment