When I am writing queries, I will do so in steps. Sometimes, in the process I will realize that I've made a "mistake" such as ending up with extra or losing records. So, I will typically compare the two queries like so:
(Select blah blah blah ) Mine
Inner join
((Select blah blah blah ) Orig
Where Mine.PK <> Orig.PK
or if I'm looking for missing or extra records I will use a left join instead and look for nulls.
Is there a better way to quickly figure out why two queries are returning different numbers of records?