- #1
- 7,019
- 10,590
Hi all,
I think I found the answer to determine whether two SQL tables are equal. Symmetric difference of sets:
A(Symmetric Difference) B = ## A \cup B - (A\cap B) ##. One can show that sets A,B are equal iff
A (Symmetric Difference) B =A (=B, of course)
How does one implement this in the language of MS SQL?
For normalized tables, one can use 'EXCEPT' or 'INTERSECT' , but this does not work for non-normalized tables with repeated records.
I think I found the answer to determine whether two SQL tables are equal. Symmetric difference of sets:
A(Symmetric Difference) B = ## A \cup B - (A\cap B) ##. One can show that sets A,B are equal iff
A (Symmetric Difference) B =A (=B, of course)
How does one implement this in the language of MS SQL?
For normalized tables, one can use 'EXCEPT' or 'INTERSECT' , but this does not work for non-normalized tables with repeated records.