New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulate INTERSECT and EXCEPT where they aren't natively supported #3581

Open
lukaseder opened this Issue Aug 22, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@lukaseder
Copy link
Member

lukaseder commented Aug 22, 2014

A few databases (Access, Firebird) do not support INTERSECT, and EXCEPT. These constructs can be emulated, however as follows:

INTERSECT

select distinct
  a.*
from
  a
  inner join b on a.id = b.id -- actual predicate must compare all columns

MINUS

select distinct
  a.*
from
  a
  left outer join b on a.id = b.id -- actual predicate must compare all columns
where
  b.id is null -- actual predicate must compare all columns

http://stackoverflow.com/a/337203/521799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment