How can I implement SQL INTERSECT and MINUS operations in MS Access

INTERSECT is an inner join. MINUS is an outer join, where you choose only the records that don’t exist in the other table.


INTERSECT

select distinct
  a.*
from
  a
  inner join b on a.id = b.id

MINUS

select distinct
  a.*
from
  a
  left outer join b on a.id = b.id
where
  b.id is null

If you edit your original question and post some sample data then an example can be given.

EDIT: Forgot to add in the distinct to the queries.

Leave a Comment