Thanks for looking at this. Someone smarter than me will have this answer but I have reached my limits.
I have three separate tables and am trying to compare them against each other for the purpose of testing some reports. Each of these tables are temporary tables that are populated from separate search queries. They all have an baseID that would link them. example
#1
ID value
1 5
2 6
#2
ID value
1 5
2 7
#3
ID value
1 5
2 7
I have the following query
SELECT * FROM (SELECT * FROM #1 EXCEPT SELECT * FROM #2) AS T
UNION ALL SELECT * FROM (SELECT * FROM #2 EXCEPT SELECT * FROM #1) AS T
UNION ALL SELECT * FROM (SELECT * FROM #1 EXCEPT SELECT * FROM #3) AS T
UNION ALL SELECT * FROM (SELECT * FROM #3 EXCEPT SELECT * FROM #1) AS T
UNION ALL SELECT * FROM (SELECT * FROM #2 EXCEPT SELECT * FROM #3) AS T
UNION ALL SELECT * FROM (SELECT * FROM #3 EXCEPT SELECT * FROM #2) AS T
That works really well to compare the three tables and return any different values between the three. Missing or different data in only one, and such, but if the baseID appears multiple times for the report this fails.
#1
ID value
1 5
1 6
2 6
#2
ID value
1 5
1 6
2 7
#3
ID value
1 5
1 6
2 7
in this set I am getting back a huge amount of results for #1 because the compare is doing both. I can undo this in a group or where clause but I do not know how. Any Ideas?