Skip to content

Commit

Permalink
Fixed nested query
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbizik committed Mar 16, 2022
1 parent 4a72269 commit 6bba5cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/endtoend/testdata/join_left/postgresql/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ LEFT JOIN mayors USING (mayor_id);
-- name: GetMayorsOptionalInnerSelect :many
SELECT t1.user_id, t2.full_name
FROM (
SELECT user_id FROM users WHERE users.city_id = $1 LIMIT 1 OFFSET 0
SELECT user_id, city_id FROM users WHERE users.city_id = $1 LIMIT 1 OFFSET 0
) AS t1
LEFT JOIN cities on users.city_id = cities.city_id
LEFT JOIN cities on t1.city_id = cities.city_id
LEFT JOIN (
SELECT mayors.mayor_id, mayors.full_name
FROM mayors where mayors.mayor_id = $2
Expand Down

0 comments on commit 6bba5cd

Please sign in to comment.