Re: [SQL] ordering of selected rows from an ordered subselect

2007-02-17 Thread Tom Lane
"Rajesh Kumar Mallah" <[EMAIL PROTECTED]> 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.

Re: [SQL] ordering of selected rows from an ordered subselect

2007-02-17 Thread Andrew Sullivan
On Sat, Feb 17, 2007 at 03:02:06PM +0530, Rajesh Kumar Mallah wrote: > > 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 ? No, because expensive_func(name) might d