Skip to content
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

Add Table.leftAntiJoin(Table).on(...) and Table.leftSemiJoin(Table).on(...) to simplify usage of [NOT] EXISTS / IN #1206

Closed
lukaseder opened this issue Jul 22, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@lukaseder
Copy link
Member

commented Jul 22, 2012

Instead of "thinking in SQL", some people may prefer to "think relational". So they might like to write:

-- relational
FROM A LEFT SEMI JOIN B ON A.ID = B.ID

-- SQL, EXISTS
FROM A
WHERE EXISTS (
  SELECT 1 FROM B WHERE A.ID = B.ID
)

-- SQL, IN
FROM A
WHERE A.ID IN (
  SELECT B.ID FROM B
)

-- relational
FROM A LEFT ANTI JOIN B ON A.ID = B.ID

-- SQL, EXISTS
FROM A
WHERE NOT EXISTS (
  SELECT 1 FROM B WHERE A.ID = B.ID
)

-- SQL, NOT IN
FROM A
WHERE A.ID NOT IN (
  SELECT B.ID FROM B
)

Note:

@ghost ghost assigned lukaseder Jul 22, 2012

@lukaseder lukaseder modified the milestones: Version 3.7.0, Version X: User contribution candidates Sep 9, 2015

lukaseder added a commit that referenced this issue Sep 12, 2015

[#1206] Add Table.antiJoin(Table).on(...) and Table.semiJoin(Table).o…
…n(...) to simplify usage of [NOT] EXISTS / IN

@lukaseder lukaseder added the R: Fixed label Sep 12, 2015

@lukaseder lukaseder closed this Sep 12, 2015

@lukaseder lukaseder changed the title Add Table.antiJoin(Table).on(...) and Table.semiJoin(Table).on(...) to simplify usage of [NOT] EXISTS / IN Add Table.leftAntiJoin(Table).on(...) and Table.leftSemiJoin(Table).on(...) to simplify usage of [NOT] EXISTS / IN Oct 6, 2015

lukaseder added a commit that referenced this issue Oct 6, 2015

lukaseder added a commit that referenced this issue Oct 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.