Reverse of UNION

X

XMan

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

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top