Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id EFD0B9FA326 for ; Sat, 17 Feb 2007 05:32:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 52740-01 for ; Sat, 17 Feb 2007 05:32:08 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.232]) by postgresql.org (Postfix) with ESMTP id CF6719FA0F6 for ; Sat, 17 Feb 2007 05:32:10 -0400 (AST) Received: by wr-out-0506.google.com with SMTP id i7so1740135wra for ; Sat, 17 Feb 2007 01:32:09 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=D590hYGxblA9OZWknxF1hHblMsjDil0Byz4RbjDsyqQ5pxzXLB/4AuFpYnqfEspDvNKkuq1X5uXKqPxY2XknrloT1mDaguNk7KI1n/5V0hzEL0FXWyqDlq4RsuoHPzBtjcmqvnw9F080lkEjNiUt6UeCLBzXh64N1bhpiexO04c= Received: by 10.115.95.1 with SMTP id x1mr2303611wal.1171704726440; Sat, 17 Feb 2007 01:32:06 -0800 (PST) Received: by 10.114.174.18 with HTTP; Sat, 17 Feb 2007 01:32:06 -0800 (PST) Message-ID: Date: Sat, 17 Feb 2007 15:02:06 +0530 From: "Rajesh Kumar Mallah" To: pgsql-sql@postgresql.org Subject: ordering of selected rows from an ordered subselect MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=BAYES_50, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/180 X-Sequence-Number: 27514 Hi, we know that rows in a table are not stored in any particular order and explicit order by clause is required to get data in any particular order. but does it apply to select queries from ordered subselects also ? eg 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 ? Regds mallah.