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

Fix auto alias for subquery without joins #896

Merged
merged 1 commit into from Mar 4, 2020

Conversation

nikolay-kisel
Copy link
Contributor

@nikolay-kisel nikolay-kisel commented Sep 8, 2019

Need to use table from main query in where condition of subquery.

Example after fix:
select a.id from table_a a left join table_b b on a.id = b.outer_id left join table_c c on a.id = c.outer_id where c.id in (select max(d.id) from table_d d where d.outer_id = a.id))

Without fix:
select a.id from table_a a left join table_b b on a.id = b.outer_id left join table_c c on a.id = c.outer_id where c.id in (select max(id)) from table_d where outer_id = id))

@CLAassistant
Copy link

CLAassistant commented Sep 8, 2019

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@npurushe npurushe merged commit 7ff4933 into requery:master Mar 4, 2020
1 check was pending
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.

None yet

4 participants