Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 286D6635D72 for ; Fri, 31 Jul 2009 11:10:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 22705-05 for ; Fri, 31 Jul 2009 14:10:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from perseverance.services.encs.concordia.ca (perseverance-96.encs.concordia.ca [132.205.96.94]) by mail.postgresql.org (Postfix) with ESMTP id D069A632F61 for ; Fri, 31 Jul 2009 11:05:52 -0300 (ADT) Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by perseverance.services.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id n6VE5nI2019702; Fri, 31 Jul 2009 10:05:49 -0400 Message-ID: <4A72FA3D.7090505@encs.concordia.ca> Date: Fri, 31 Jul 2009 10:05:49 -0400 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: sergey kapustin CC: pgsql-sql@postgresql.org Subject: Re: Show CAS, USD first; the left ordered by currency name References: <4A71F9CB.9050805@encs.concordia.ca> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on perseverance.encs.concordia.ca at 2009/07/31 10:05:49 EDT X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/162 X-Sequence-Number: 32903 "order by code not in ('USD', 'EUR', 'CAD') , code" is exactly what I was looking for! Good to know how "order by not in" works and thank you very much for all your inputs! -- Lu Ying > ...order by currency not in('USD', 'AND', 'CAD'); > > this condition will be avaluated as FALSE for USD, AND and CAD, and as > TRUE for all other currencies. When the records are sorted the "false" > are placed on the top because false > On Thu, Jul 30, 2009 at 10:51 PM, Emi Lu > wrote: > > Good morning, > > I have a currency table (code, description). > > Example values: > ADF | Andorran Franc > ... ... > ANG | NL Antillian Guilder > AON | Angolan New Kwanza > AUD | Australian Dollar > AWG | Aruban Florin > BBD | Barbados Dollar > USD | US Dollar > CAD | Canadian Dollar > > Is there a way I can query to display USD AND CAD first, while other > rows are ordered by Code. > > For example, > > CAS | Canadian Dollar > USD | US Dollar > ADF | Andorran Franc > ... > > > Thanks a lot! > -- > Lu Ying > > > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > >