pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Wei Weng <wweng@kencast.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How do you compare (NULL) and (non-NULL)?
Date: Wed, 27 Oct 2004 10:36:43 -0500
Message-ID: <20041027153643.GA14288@wolff.to> (raw)
In-Reply-To: <417EB238.1000109@kencast.com>
References: <417EB238.1000109@kencast.com>

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.



view thread (6+ messages)  latest in thread

Message-ID: <20041027153643.GA14288@wolff.to>
Permalink:  ../20041027153643.GA14288@wolff.to/
Also on:    postgresql.org/message-id/20041027153643.GA14288@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, wweng@kencast.com
  Subject: Re: How do you compare (NULL) and (non-NULL)?
  In-Reply-To: <20041027153643.GA14288@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox