Add order by to multi_subquery_complex_reference_clause

pull/2736/head
Onder Kalaci 2019-05-28 12:06:57 +02:00
parent d4dbe8f008
commit 1553e12ee4
2 changed files with 5 additions and 3 deletions

View File

@ -576,12 +576,13 @@ SELECT * FROM
users_table as "users" users_table as "users"
WHERE WHERE
user_id > 2 and value_2 = 1) as foo_in ON (event_val_2 = user_id)) as foo LEFT JOIN user_id > 2 and value_2 = 1) as foo_in ON (event_val_2 = user_id)) as foo LEFT JOIN
(SELECT user_id as user_user_id FROM users_table) as fooo ON (user_id = user_user_id)) as bar; (SELECT user_id as user_user_id FROM users_table) as fooo ON (user_id = user_user_id)) as bar
ORDER BY 1;
user_id user_id
--------- ---------
5
3 3
4 4
5
(3 rows) (3 rows)
-- the same query but this time reference table is in the outer part of the query -- the same query but this time reference table is in the outer part of the query

View File

@ -354,7 +354,8 @@ SELECT * FROM
users_table as "users" users_table as "users"
WHERE WHERE
user_id > 2 and value_2 = 1) as foo_in ON (event_val_2 = user_id)) as foo LEFT JOIN user_id > 2 and value_2 = 1) as foo_in ON (event_val_2 = user_id)) as foo LEFT JOIN
(SELECT user_id as user_user_id FROM users_table) as fooo ON (user_id = user_user_id)) as bar; (SELECT user_id as user_user_id FROM users_table) as fooo ON (user_id = user_user_id)) as bar
ORDER BY 1;
-- the same query but this time reference table is in the outer part of the query -- the same query but this time reference table is in the outer part of the query
SELECT * FROM SELECT * FROM