pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: ordering of selected rows from an ordered subselect
Date: Sat, 17 Feb 2007 10:24:34 -0500
Message-ID: <20070217152434.GA3623@phlogiston.dyndns.org> (raw)
In-Reply-To: <a97c77030702170132h51962513j929786b4f45aa50f@mail.gmail.com>
References: <a97c77030702170132h51962513j929786b4f45aa50f@mail.gmail.com>

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 do something that alters it,
no?  All things considered, it's a pretty good _bet_ it will be
ordered as you wish, though.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The whole tendency of modern prose is away from concreteness.
		--George Orwell



view thread (3+ messages)  latest in thread

Message-ID: <20070217152434.GA3623@phlogiston.dyndns.org>
Permalink:  ../20070217152434.GA3623@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20070217152434.GA3623@phlogiston.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: ordering of selected rows from an ordered subselect
  In-Reply-To: <20070217152434.GA3623@phlogiston.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox