Behavior of subselects in target lists and order by

Поиск
Список
Период
Сортировка
От amit sehas
Тема Behavior of subselects in target lists and order by
Дата
Msg-id 1330116341.57093.YahooMailClassic@web160503.mail.bf1.yahoo.com
обсуждение исходный текст
Список pgsql-hackers
If we have a query of the form:

Select *, (Select * FROM T2 WHERE p2 = T1.p1) FROM T1 ORDER BY 1 WHERE p3 = 75

In the above query there is a subselect in the target list and the ORDERBY has an ordinal number which indicates order
bycolumn 1. Does this mean that the above query will return all results from T1 that match p3 =75 and all results from
T2that match p2 = T1.p1 for every match on T1 and order them all by the first column of T1 and T2 ? 

basically i am trying to determine if the order by clause has effect only on the tuples of the outer select or both the
outerand inner select. Or the results returned by the inner select are treated as if they are part of a single tuple
whichincludes the tuple from table T1 ? 

Is this an implementation specific behaviour or it conforms to the SQL standard ...?

thanks
-Amit

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: COPY with hints, rebirth
Следующее
От: Bruce Momjian
Дата:
Сообщение: Cleanup of make_ctags