Re: ORDER BY TIMESTAMP_column ASC, NULL first

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Fredrik Wendt <fredrik(at)csbnet(dot)se>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ORDER BY TIMESTAMP_column ASC, NULL first
Date: 2004-02-15 20:01:38
Message-ID: 20040215115858.E88869@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2004-02-15 20:03:47 Re: max timestamp
Previous Message Tomasz Myrta 2004-02-15 20:01:37 Re: max timestamp