Created
January 27, 2016 09:18
-
-
Save dnasca/6702bfe119edeb34491d to your computer and use it in GitHub Desktop.
Multi-attribute Join - The join condition can involve more than one column from each input. Multi-attribute joins are commonly used for PK/FK associations between data sources involving more than one attribute on each side
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
--which rows are in the production table that are not in the archive table? | |
SELECT | |
bea.BusinessEntityId, | |
bea.AddressId, | |
bea.AddressTypeId, | |
bea.rowguid, | |
bea.ModifiedDate | |
FROM | |
Person.BusinessEntityAddress AS bea | |
LEFT OUTER JOIN | |
Person.BusinessEntityAddressArchive as abea | |
ON | |
bea.BusinessEntityId = abea.BusinessEntityId AND | |
bea.AddressId = abea.AddressId AND | |
bea.AddressTypeId = abea.AddressTypeId | |
WHERE | |
abea.BusinessEntityId IS NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment