Re: 7.4, 'group by' default ordering?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Ron St-Pierre <rstpierre(at)syscor(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 7.4, 'group by' default ordering?
Date: 2004-01-09 05:35:37
Message-ID: 20040109053537.GA16742@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 08, 2004 at 15:24:41 -0800,
Ron St-Pierre <rstpierre(at)syscor(dot)com> wrote:
> Celko uses the SQL92 13.1 rule wording: "Whether a sort key value that
> is NULL is considered greater or less than a non-NULL value is
> implementation defined, but all sort key values that are NULL will
> either be considered greater than all non-NULL values or be considered
> less than all non-NULL values. There are SQL products that do it either
> way." 2nd Ed SQL For Smarties.

The part just after that prompted my statement. The text is:
And there are those that have it all wrong; the Sybase family simply
treats the NULLs as if they were really values -- that is, they sort
low for ascending and high for descending.

This seems to me to be saying contradictory things now that I have reread it.
If NULLs are treated as real values, I would expect them to be output
first for one of descending and ascending and last for the other. But
the second part of the statement contradicts this and seems to be saying
that Sybase always emits records with NULL values for the key first.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Swan 2004-01-09 07:07:24 Re: psql \d option list overloaded
Previous Message Tom Lane 2004-01-09 05:03:27 Re: Natural upgrade path for RedHat 9?