X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 82349D1DAB0 for ; Mon, 16 Feb 2004 08:02:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 23708-10 for ; Mon, 16 Feb 2004 04:01:57 -0400 (AST) Received: from cyber12.e-insites.com (ns10.nic-reg-dns.com [66.206.10.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3D8F0D1DAA7 for ; Mon, 16 Feb 2004 04:01:54 -0400 (AST) Received: from server2k ([61.11.69.7]) by cyber12.e-insites.com with MailEnable ESMTP; Mon, 16 Feb 2004 00:05:52 -0800 Received: from 192.168.50.15 by server2k ([192.168.50.102] running VPOP3) with SMTP; Mon, 16 Feb 2004 13:38:06 +0530 X-MSReally-From: sqllist@coralindia.com Message-ID: <006c01c3f462$77bf3d60$0f32a8c0@denisnew> From: "Denis" To: References: <20040212100626.GA21864@csbnet.se> <1076871769.10896.140.camel@jester> Subject: Re: ORDER BY TIMESTAMP_column ASC, NULL first Date: Mon, 16 Feb 2004 13:27:02 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Server: VPOP3 V1.5.0 - Registered X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=4.9 tagged_above=0.0 required=5.0 tests=BAYES_01, RCVD_IN_DSBL, RCVD_IN_NJABL, RCVD_IN_NJABL_PROXY, RCVD_IN_OPM, RCVD_IN_OPM_HTTP, RCVD_IN_SORBS, RCVD_IN_SORBS_HTTP, RCVD_IN_SORBS_MISC, RCVD_IN_SORBS_SOCKS X-Spam-Level: **** X-Archive-Number: 200402/191 X-Sequence-Number: 16881 Hi Rod, Try this.... ace=> create table test(name text, age int ); CREATE ace=> insert into test values ('Denis',26); INSERT 1823531 1 ace=> insert into test values (null,26); INSERT 1823532 1 ace=> select * from test order by name; name | age -------+----- Denis | 26 | 26 (2 rows) ace=> select * from test order by coalesce(name,''); name | age -------+----- | 26 Denis | 26 HTH Thanx Denis ----- Original Message ----- From: "Rod Taylor" To: "Fredrik Wendt" Cc: Sent: Monday, February 16, 2004 12:32 AM Subject: Re: [SQL] ORDER BY TIMESTAMP_column ASC, NULL first > On Thu, 2004-02-12 at 05:06, Fredrik Wendt wrote: > > Hi! > > > > I read posts telling me that NULL values are considered greater than > > non-null values. Fine. Is there a way to explicitly reverse this? > > ORDER BY column IS NOT NULL, column ASC; > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)