X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5D0F23A3CBA for ; Wed, 27 Oct 2004 16:31:32 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95870-08 for ; Wed, 27 Oct 2004 15:31:26 +0000 (GMT) Received: from axiontech.com (unknown [216.52.172.78]) by svr1.postgresql.org (Postfix) with SMTP id 674AB3A4677 for ; Wed, 27 Oct 2004 16:31:25 +0100 (BST) Received: (qmail 13081 invoked from network); 27 Oct 2004 15:31:35 -0000 Received: from pc-00161 (HELO yudie) (192.168.1.161) by mail.axiontech.com (192.168.1.6) with SMTP; 27 Oct 2004 15:31:35 -0000 Message-ID: <003001c4bc39$dd0470b0$a101a8c0@home.axiontech.com> From: "Yudie" To: References: <003001c4bb91$4c6647c0$a101a8c0@home.axiontech.com> <1098822881.2414.42.camel@linda> <13739.1098827021@sss.pgh.pa.us> Subject: Re: How to re-sort a sorted query? Date: Wed, 27 Oct 2004 10:30:15 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/198 X-Sequence-Number: 19301 > select * from > (select distinct on (storenumber), itemsku, storenumber,price > from storeproduct where itemsku='10001' > order by storenumber, price) ss > order by price; > > regards, tom lane Thanks tom, this is working. I never thought it could be done like this. yudie > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >