Reverse of UNION

  • Thread starter Thread starter XMan
  • Start date Start date
X

XMan

Instead of combining results of two queries, is there a way to get the
difference between them? TIA.
 
XMan said:
Instead of combining results of two queries, is there a way to get the
difference between them?

Depends on what you mean by "difference". Usually this
means all the records in tableA that are not in tableB. If
that's what you want, then use a frustrated Join type query:

SELECT tableA.*
FROM tableA LEFT JOIN tableB
ON tableA.fielda = tableB.fieldb
WHERE tableb.fieldb IS NULL
 
Back
Top