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

I have researched and haven't found a way to run INTERSECT and MINUS operations in MS Access. Does any way exist

Answers


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.


Need Your Help

Access control of a Module in Yii2

login module yii2 rbac

I am having a trouble with login part.

C++ reversing char* adds "a"

c++

I have a HUGE problem, I am printing in console reverse arguments, for example "./program.exe foo bar sula" would output "oof rab alus", but for some reason it adds "a" before every word "aoof arab...