Is subtraction of inner join from full outer join some type of “join”?
up vote
0
down vote
favorite
Given two tables, is there a name for the result of subtracting inner join from full outer join, both on the same condition? Is it a type of "join"? Thanks.
sql
add a comment |
up vote
0
down vote
favorite
Given two tables, is there a name for the result of subtracting inner join from full outer join, both on the same condition? Is it a type of "join"? Thanks.
sql
it's ananti-join
which doesn't exist as syntax in SQL (don't know for Relational Theory), must be written usingEXPECT
or twoNOT EXISTS
– dnoeth
Nov 10 at 22:42
What information are you trying to extract from the tables?
– Shawn
Nov 10 at 22:46
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Given two tables, is there a name for the result of subtracting inner join from full outer join, both on the same condition? Is it a type of "join"? Thanks.
sql
Given two tables, is there a name for the result of subtracting inner join from full outer join, both on the same condition? Is it a type of "join"? Thanks.
sql
sql
asked Nov 10 at 22:25
Ben
1527
1527
it's ananti-join
which doesn't exist as syntax in SQL (don't know for Relational Theory), must be written usingEXPECT
or twoNOT EXISTS
– dnoeth
Nov 10 at 22:42
What information are you trying to extract from the tables?
– Shawn
Nov 10 at 22:46
add a comment |
it's ananti-join
which doesn't exist as syntax in SQL (don't know for Relational Theory), must be written usingEXPECT
or twoNOT EXISTS
– dnoeth
Nov 10 at 22:42
What information are you trying to extract from the tables?
– Shawn
Nov 10 at 22:46
it's an
anti-join
which doesn't exist as syntax in SQL (don't know for Relational Theory), must be written using EXPECT
or two NOT EXISTS
– dnoeth
Nov 10 at 22:42
it's an
anti-join
which doesn't exist as syntax in SQL (don't know for Relational Theory), must be written using EXPECT
or two NOT EXISTS
– dnoeth
Nov 10 at 22:42
What information are you trying to extract from the tables?
– Shawn
Nov 10 at 22:46
What information are you trying to extract from the tables?
– Shawn
Nov 10 at 22:46
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
It is not a type of join
in SQL. You can write it as:
select . . .
from a full join
b
on a.id = b.id
where a.id is null or b.id is null;
If you are looking for id
s that are in only one table, it can be more efficient to do:
select a.id
from a
where not exists (select 1 from b where b.id = a.id)
union all
select b.id
from b
where not exists (select 1 from a where a.id = b.id);
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
It is not a type of join
in SQL. You can write it as:
select . . .
from a full join
b
on a.id = b.id
where a.id is null or b.id is null;
If you are looking for id
s that are in only one table, it can be more efficient to do:
select a.id
from a
where not exists (select 1 from b where b.id = a.id)
union all
select b.id
from b
where not exists (select 1 from a where a.id = b.id);
add a comment |
up vote
1
down vote
It is not a type of join
in SQL. You can write it as:
select . . .
from a full join
b
on a.id = b.id
where a.id is null or b.id is null;
If you are looking for id
s that are in only one table, it can be more efficient to do:
select a.id
from a
where not exists (select 1 from b where b.id = a.id)
union all
select b.id
from b
where not exists (select 1 from a where a.id = b.id);
add a comment |
up vote
1
down vote
up vote
1
down vote
It is not a type of join
in SQL. You can write it as:
select . . .
from a full join
b
on a.id = b.id
where a.id is null or b.id is null;
If you are looking for id
s that are in only one table, it can be more efficient to do:
select a.id
from a
where not exists (select 1 from b where b.id = a.id)
union all
select b.id
from b
where not exists (select 1 from a where a.id = b.id);
It is not a type of join
in SQL. You can write it as:
select . . .
from a full join
b
on a.id = b.id
where a.id is null or b.id is null;
If you are looking for id
s that are in only one table, it can be more efficient to do:
select a.id
from a
where not exists (select 1 from b where b.id = a.id)
union all
select b.id
from b
where not exists (select 1 from a where a.id = b.id);
answered Nov 10 at 22:59
Gordon Linoff
745k32285390
745k32285390
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244025%2fis-subtraction-of-inner-join-from-full-outer-join-some-type-of-join%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
it's an
anti-join
which doesn't exist as syntax in SQL (don't know for Relational Theory), must be written usingEXPECT
or twoNOT EXISTS
– dnoeth
Nov 10 at 22:42
What information are you trying to extract from the tables?
– Shawn
Nov 10 at 22:46