Re: Sorting by NULL values - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Sorting by NULL values
Date
Msg-id 20030304120713.W55865-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Sorting by NULL values  (Ian Burrell <ib@onsitetech.com>)
Responses Re: Sorting by NULL values  (Rod Taylor <rbt@rbt.ca>)
List pgsql-sql
On Tue, 4 Mar 2003, Ian Burrell wrote:

> I am doing a query where I need to sort by a column that may be NULL
> because it is coming from an OUTER JOIN.  I noticed a difference between
> PostgreSQL and other databases about where NULLs show up.  It seems that
> with Postgres, NULLs are sorted after other values.  Other databases
> sort them before.

> Is there any standard on how sorting NULLs work?  Is there a way to

IIRC, they're either considered greater than or less than non-NULL values,
but the decision is up to the implementation.

> change Postgres's behavior?  Is there a way to replace the NULLs with
> empty strings?

Coalesce should work.





pgsql-sql by date:

Previous
From: Tomasz Myrta
Date:
Subject: Re: Sorting by NULL values
Next
From: Josh Berkus
Date:
Subject: Re: Sorting by NULL values