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 2ABC9D1DD17 for ; Sun, 15 Feb 2004 20:01:41 +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 68551-07 for ; Sun, 15 Feb 2004 16:01:38 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 0BC5DD1DCDD for ; Sun, 15 Feb 2004 16:01:37 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 2EF0C35564; Sun, 15 Feb 2004 12:01:38 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 2AC6735561; Sun, 15 Feb 2004 12:01:38 -0800 (PST) Date: Sun, 15 Feb 2004 12:01:38 -0800 (PST) From: Stephan Szabo To: Fredrik Wendt Cc: pgsql-sql@postgresql.org Subject: Re: ORDER BY TIMESTAMP_column ASC, NULL first In-Reply-To: <20040212100626.GA21864@csbnet.se> Message-ID: <20040215115858.E88869@megazone.bigpanda.com> References: <20040212100626.GA21864@csbnet.se> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/180 X-Sequence-Number: 16870 On Thu, 12 Feb 2004, Fredrik Wendt wrote: > I read posts telling me that NULL values are considered greater than > non-null values. Fine. Is there a way to explicitly reverse this? Not directly, but I think ORDER BY assignedAt IS NOT NULL, assignedAt ASC will give the ordering you want at the cost of probably not using an index on assignedAt.