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

SQL: LEFT JOIN error fixed #110

Merged
merged 1 commit into from
Feb 12, 2018
Merged

SQL: LEFT JOIN error fixed #110

merged 1 commit into from
Feb 12, 2018

Conversation

maria-grigorieva
Copy link
Contributor

@maria-grigorieva maria-grigorieva commented Feb 12, 2018

The issue is that LEFT JOIN doesn't return all records
from the left table.

The solution is to change WHERE clause to AND
so that the condition is part of the join condition, not a filter applied after the join.
Now all rows in the left table will be present in the result.

Copy link
Collaborator

@mgolosova mgolosova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I`d move AND on the next line (with jd.type in ...).
I mean, to make it look like this:

LEFT JOIN ...
    ON ...
        AND ...
        AND ...

instead of

LEFT JOIN ...
    ON ... AND
        ...
        AND ...

The issue was that LEFT JOIN doesn't return all records
from the left table.

The solution is to change WHERE clause to AND
so that the condition is part of the join condition, not a filter applied after the join.
Now all rows in the left table will be present in the result.
@maria-grigorieva
Copy link
Contributor Author

Ok! I've just move AND by rebasing the commit.
Thank you.

@mgolosova
Copy link
Collaborator

Ok, thank you!

@mgolosova mgolosova merged commit 076bf1c into master Feb 12, 2018
@mgolosova mgolosova deleted the oracle_request_fix branch February 12, 2018 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants