From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Wei Weng <wweng@kencast.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How do you compare (NULL) and (non-NULL)?
Date: Tue, 26 Oct 2004 13:48:48 -0700 (PDT)
Message-ID: <20041026134508.N5021@megazone.bigpanda.com> (raw)
In-Reply-To: <417EB238.1000109@kencast.com>
References: <417EB238.1000109@kencast.com>
On Tue, 26 Oct 2004, Wei Weng 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.
The spec basically says (IIRC) that implementations must either treat all
nulls as greater than all non-nulls for ordering or less than all
non-nulls for ordering, but that different implementations may choose
different choices. I think the most recent version (at least) provides an
option to specify which way to handle nulls, but we don't support that as
far as I know.
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: sszabo@megazone.bigpanda.com, wweng@kencast.com
Subject: Re: How do you compare (NULL) and (non-NULL)?
In-Reply-To: <20041026134508.N5021@megazone.bigpanda.com>
* 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