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 4C86E564C3 for ; Wed, 9 Mar 2005 13:09:33 +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 06294-06 for ; Wed, 9 Mar 2005 13:09:24 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id F3AE2564A3 for ; Wed, 9 Mar 2005 13:09:22 +0000 (GMT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id j29Dmc1M016911; Wed, 9 Mar 2005 15:48:38 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id j29DmcBs016907; Wed, 9 Mar 2005 15:48:38 +0200 Date: Wed, 9 Mar 2005 15:48:38 +0200 (EET) From: Achilleus Mantzios To: Gary Stainburn Cc: pgsql-sql@postgresql.org Subject: Re: order by question In-Reply-To: <200503091241.55881.gary.stainburn@ringways.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/147 X-Sequence-Number: 20626 O Gary Stainburn έγραψε στις Mar 9, 2005 : > 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; use the case ... when .. then ... when ... then ... else ... construct. > > 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. > > Is it possible and if so how do I do it? > -- -Achilleus