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

Left/Right join with a subquery doesn't work #74

Open
Arnex93 opened this issue Feb 4, 2021 · 0 comments · May be fixed by #85
Open

Left/Right join with a subquery doesn't work #74

Arnex93 opened this issue Feb 4, 2021 · 0 comments · May be fixed by #85

Comments

@Arnex93
Copy link

Arnex93 commented Feb 4, 2021

Hello,

Here is my query :

SELECT a.* FROM a
    LEFT JOIN (
        SELECT b.id, b.name
        FROM b
        ORDER BY b.date_created DESC
        LIMIT 1
   ) c
ON c.id = a.iduser

and Magic Query removes the "JOIN" keyword (not for a simple JOIN), here is the result:

SELECT `a`.* FROM `a` LEFT (SELECT `b`.`id`, `b`.`name` FROM `b` ORDER BY `b`.`date_created` DESC LIMIT 1) `c` ON ( `c`.`id` = `a`.`iduser`)

Any idea how to solve this issue ?

Thanks in advance!

rodion-k added a commit to rodion-k/magic-query that referenced this issue Feb 1, 2022
@rodion-k rodion-k linked a pull request Feb 1, 2022 that will close this issue
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 a pull request may close this issue.

1 participant