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

Lateral problem #168

Merged
merged 3 commits into from
Dec 27, 2020
Merged

Lateral problem #168

merged 3 commits into from
Dec 27, 2020

Conversation

emin100
Copy link
Contributor

@emin100 emin100 commented Mar 30, 2020

LATERAL JOIN problem

expected: SELECT *
FROM "tb_test_main" mh
JOIN LATERAL (
SELECT "ftnrm".* FROM "test" ftnrm WHERE "ftnrm"."hizmet_id" = "mh"."id"
UNION ALL
SELECT "ftarc".* FROM "test"."test2" ftarc WHERE "ftarc"."hizmet_id" = "mh"."id"
) ft ON true
)

got: SELECT *
FROM "tb_test_main" mh
JOIN (
SELECT "ftnrm".* FROM "test" ftnrm WHERE "ftnrm"."hizmet_id" = "mh"."id"
UNION ALL
SELECT "ftarc".* FROM "test"."test2" ftarc WHERE "ftarc"."hizmet_id" = "mh"."id"
) ft ON true
)

Mehmet Emin KARAKAŞ and others added 3 commits March 30, 2020 15:15
expected: SELECT *
                            FROM "tb_test_main" mh
                            JOIN LATERAL (
                              SELECT "ftnrm".* FROM "test" ftnrm WHERE "ftnrm"."hizmet_id" = "mh"."id"
                              UNION ALL
                              SELECT "ftarc".* FROM "test"."test2" ftarc WHERE "ftarc"."hizmet_id" = "mh"."id"
                            ) ft ON true
                    )

got: SELECT *
                       FROM "tb_test_main" mh
                       JOIN (
                         SELECT "ftnrm".* FROM "test" ftnrm WHERE "ftnrm"."hizmet_id" = "mh"."id"
                         UNION ALL
                         SELECT "ftarc".* FROM "test"."test2" ftarc WHERE "ftarc"."hizmet_id" = "mh"."id"
                       ) ft ON true
               )
expected: SELECT *
                            FROM "tb_test_main" mh
                            JOIN LATERAL (
                              SELECT "ftnrm".* FROM "test" ftnrm WHERE "ftnrm"."hizmet_id" = "mh"."id"
                              UNION ALL
                              SELECT "ftarc".* FROM "test"."test2" ftarc WHERE "ftarc"."hizmet_id" = "mh"."id"
                            ) ft ON true
                    )

got: SELECT *
                       FROM "tb_test_main" mh
                       JOIN (
                         SELECT "ftnrm".* FROM "test" ftnrm WHERE "ftnrm"."hizmet_id" = "mh"."id"
                         UNION ALL
                         SELECT "ftarc".* FROM "test"."test2" ftarc WHERE "ftarc"."hizmet_id" = "mh"."id"
                       ) ft ON true
               )
@lfittl lfittl merged commit 234043b into pganalyze:master Dec 27, 2020
@emin100 emin100 deleted the lateral_problem branch December 28, 2020 06:08
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