Re: How do I change sort order behavious with nulls

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: charlie clark <charlie(at)begeistert(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I change sort order behavious with nulls
Date: 2005-02-19 17:43:04
Message-ID: 17829.1108834984@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

charlie clark <charlie(at)begeistert(dot)org> writes:
> is there a simple way to change the way ORDER BY works on columns with
> NULLs?

No, but you can do something like

ORDER BY foo IS NOT NULL, foo DESC

to make the nulls come first.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Finner 2005-02-19 17:46:25 Re: Client lib v. 7.3 to access 8.0 db server. Compatible
Previous Message Tom Lane 2005-02-19 17:40:40 Re: Group By and wildcards...