I am replacing an old untidy SQL query with a new version, because it was failing to include several rows it should have.
The new query certainly includes these missing rows, but I want to be entirely sure that it also includes all of the rows from the original query.
The two queries use entirely different tables. Each query is ~14000 rows.
Is there a query I can write that checks whether QueryA contains any rows that QueryB does not have?
You could do something like this.
You can either include all the columns in the “on clause” or you can just include the columns you need to ensure the rows are the same, such as the primary key.