I have two tables and i want to make a query that returns the difference. I have tried:
SELECT person1.*
FROM dbo.REL_IMS_PERSON person1
WHERE (NOT EXISTS(
SELECT person2.*
FROM dbo.REL_IMS_PERSON_ODS person2
WHERE person1.id = person2.id AND person1.fn = person2.fn))
This works fine as long as none of the fields is null.
Any suggestions or other ways of comparing two tables? Any help would be greatly appreciated.
SELECT person1.*
FROM dbo.REL_IMS_PERSON person1
WHERE (NOT EXISTS(
SELECT person2.*
FROM dbo.REL_IMS_PERSON_ODS person2
WHERE person1.id = person2.id AND person1.fn = person2.fn))
This works fine as long as none of the fields is null.
Any suggestions or other ways of comparing two tables? Any help would be greatly appreciated.