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

From Josh Berkus
Subject Re: Sorting by NULL values
Date
Msg-id 200303041101.52565.josh@agliodbs.com
Whole thread Raw
In response to Sorting by NULL values  (Ian Burrell <ib@onsitetech.com>)
List pgsql-sql
Ian,

> 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.

Not all other databases.   It really depends.

> Is there a way to replace the NULLs with
> empty strings?

Sure: UPDATE table SET column = '' WHERE column IS NULL

--
Josh Berkus
josh@agliodbs.com
Aglio Database Solutions
San Francisco


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Sorting by NULL values
Next
From: Oleg Bartunov
Date:
Subject: Re: Gist indexes on int arrays