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

Re: NULL sorts as largest?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Dmitri Bichko <dbichko(at)genpathpharma(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: NULL sorts as largest?
Date: 2003-05-27 23:00:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Tue, 27 May 2003, Dmitri Bichko wrote:

> I am noticing that null values come out as the largest value when
> sorting on a field (or last with ASC and first with DESC).  Is there any
> way to change this behaviour?  It's somewhat strange to do a descending
> sort on a column and get all the stuff that's not there first.

I think the best you can do is ordering by field is [not] null first and
then by the field (choosing not depending on the sort order you want).

In response to

pgsql-general by date

Next:From: Nikola MilutinovicDate: 2003-05-28 05:15:34
Subject: Re: PostgreSQL 7.3.1 on WinXP
Previous:From: Stephan SzaboDate: 2003-05-27 22:57:12
Subject: Re: Bizzare plpgsql error

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