Created
June 12, 2017 16:52
-
-
Save jbaxleyiii/e49297274bbbf1c34c066f3aec308207 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 | |
P.Id, | |
P.FirstName, | |
P.LastName, | |
P.Email | |
FROM | |
[Person] P | |
JOIN [PersonAlias] PA | |
ON PA.PersonId = P.Id | |
JOIN [PersonalDevice] PD | |
ON PD.PersonAliasId = PA.Id | |
WHERE | |
EXISTS ( | |
SELECT Id | |
FROM [PersonalDevice] PDA | |
WHERE PDA.PersonAliasId = PA.Id | |
) | |
Group By | |
P.Id, | |
P.FirstName, | |
P.LastName, | |
P.Email |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment