how do i compare rows as lists in sql?

You can search for unmatched rows of a full outer join.

For example the following query finds any difference between group 10 and 11:

select *
from table1 a
full join table1 b on a.key2 = b.key2 and a.key3 = b.key3
where a.key2 is null or b.key2 is null
  and a.key1 = 10 and b.key1 = 11

If the query returns no rows, then the groups are identical.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top