A FULL OUTER JOIN is neither "left" nor "right"— it's both!
SELECT
* FROM
@tblSource AS tblSource
FULL OUTER JOIN @tblTarget AS tblTarget ON tblTarget.ID = tblSource.ID
WHERE tblSource.ID IS NULL AND tblTarget.ID IS NOT NULL
check null to fillter rows that in both table.
SELECT
* FROM
@tblSource AS tblSource
FULL OUTER JOIN @tblTarget AS tblTarget ON tblTarget.ID = tblSource.ID
WHERE tblSource.ID IS NULL AND tblTarget.ID IS NOT NULL
check null to fillter rows that in both table.
No comments:
Post a Comment