Skip to content

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

Description

@Arnex93

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions