Re: How do you compare (NULL) and (non-NULL)? - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: How do you compare (NULL) and (non-NULL)?
Date
Msg-id 20041027153643.GA14288@wolff.to
Whole thread Raw
In response to How do you compare (NULL) and (non-NULL)?  (Wei Weng <wweng@kencast.com>)
Responses Re: How do you compare (NULL) and (non-NULL)?
List pgsql-sql
On Tue, Oct 26, 2004 at 16:23:20 -0400, Wei Weng <wweng@kencast.com> wrote:
> In the following query
> 
> SELECT Parent FROM Channels ORDER BY Parent ASC;
> 
> If I have a couple of (NULL)s in the field [Parent], they will be listed at 
> the bottom of the query result.
> 
> Is it because PostgreSQL considers (NULL) as the biggest value? If I run 
> the same query under MSSQL Server 2000, I get the exact opposite result 
> regarding the order of (NULL)s and (non-NULL) values. They are listed at 
> the very beginning of the query result.

If the order matters, you can order by IS NULL or IS NOT NULL.


pgsql-sql by date:

Previous
From: Jeff Boes
Date:
Subject: How to recognize trigger-inserted rows?
Next
From: "Yudie"
Date:
Subject: Re: How to re-sort a sorted query?