Re: ordering of selected rows from an ordered subselect

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ordering of selected rows from an ordered subselect
Дата
Msg-id 19515.1171729894@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ordering of selected rows from an ordered subselect  ("Rajesh Kumar Mallah" <mallah.rajesh@gmail.com>)
Список pgsql-sql
"Rajesh Kumar Mallah" <mallah.rajesh@gmail.com> writes:
> select   id , name , expensive_func(name)  from
>         ( select id , name from tab  order by c1 desc limit 15)  as foo ;
> is it guaranteed that the final result is order by c1 ?

The sub-select's output will be emitted in the specified order.  What
happens after that depends on the outer query, but if you don't have any
joining or grouping then it's a reasonably safe bet that the final
output will be in the same order.
        regards, tom lane


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