You could also: create a unique PK for your dataset such that the PK for a row is the same for A and B, and then union anti joins to get your result: (A anti B) U (B anti A). That should give you : all rows that are in A that aren’t in B, and all rows in B that aren’t in A.