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 D0E1C52A55 for ; Wed, 9 Mar 2005 14:10:28 +0000 (GMT) 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 25089-03 for ; Wed, 9 Mar 2005 14:10:19 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 7ABEA563BE for ; Wed, 9 Mar 2005 14:10:18 +0000 (GMT) Received: (qmail 32665 invoked by uid 500); 9 Mar 2005 14:26:11 -0000 Date: Wed, 9 Mar 2005 08:26:11 -0600 From: Bruno Wolff III To: Gary Stainburn Cc: pgsql-sql@postgresql.org Subject: Re: order by question Message-ID: <20050309142611.GB32013@wolff.to> Mail-Followup-To: Bruno Wolff III , Gary Stainburn , pgsql-sql@postgresql.org References: <200503091241.55881.gary.stainburn@ringways.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200503091241.55881.gary.stainburn@ringways.co.uk> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/150 X-Sequence-Number: 20629 On Wed, Mar 09, 2005 at 12:41:55 +0000, Gary Stainburn wrote: > Hi folks. > > I seem to remember somewhere being shown how to bump specific rows to > the top of a list; something along the lines of: > > select c_id as key, c_des as value from customers order by c_id = 7, > c_id = 160, value; > > however, although the statement is accepted the two rows specified are > not bumped to the top of the list, but instead appear in their correct > position in the order by value part. Are you sure? It looks like you are going to have them appear at the bottom of the list doing the above. Remember that false sorts before true.