Re: [SQL] Howto to force NULL rows at the bottom ? - Mailing list pgsql-sql

From Stoyan Genov
Subject Re: [SQL] Howto to force NULL rows at the bottom ?
Date
Msg-id 199912051153.NAA24720@lorna.digsys.bg
Whole thread Raw
In response to Howto to force NULL rows at the bottom ?  (Dirk Lutzebaeck <lutzeb@aeccom.com>)
Responses Re: [SQL] Howto to force NULL rows at the bottom ?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-sql
Hi,

If you bother about the NULLs positioned at the bottom of the selection, 
and not how
non-NULL data is ordered, you can just use ORDER BY field DESC  - this will 
position
NULLs at the bottom, ordering non-NULL data from the highest values to the 
lowest.

Regards,
Stoyan Genov

> Hi,
> 
> how can I force NULL rows at the bottom of the result list in an
> ordered SELECT?
> 
> with ORDER BY I get
> 
> NULL
> Peter
> Jane
> 
> but I want
> 
> Peter
> Jane
> NULL
> 
> --
> Dirk
> 
> ************
> 




pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] group by
Next
From: "Jonathan Karlen"
Date:
Subject: Accent Marks