Skip site navigation (1) Skip section navigation (2)

Re: How do you compare (NULL) and (non-NULL)?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Wei Weng <wweng(at)kencast(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How do you compare (NULL) and (non-NULL)?
Date: 2004-10-27 15:36:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Tue, Oct 26, 2004 at 16:23:20 -0400,
  Wei Weng <wweng(at)kencast(dot)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.

In response to


pgsql-sql by date

Next:From: Markus SchaberDate: 2004-10-28 10:03:20
Subject: Select Instead on a table
Previous:From: YudieDate: 2004-10-27 15:30:15
Subject: Re: How to re-sort a sorted query?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group