Re: [SQL] Howto to force NULL rows at the bottom ?

Поиск
Список
Период
Сортировка
От Stoyan Genov
Тема Re: [SQL] Howto to force NULL rows at the bottom ?
Дата
Msg-id 199912051153.NAA24720@lorna.digsys.bg
обсуждение исходный текст
Ответ на Howto to force NULL rows at the bottom ?  (Dirk Lutzebaeck <lutzeb@aeccom.com>)
Ответы Re: [SQL] Howto to force NULL rows at the bottom ?  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] group by
Следующее
От: "Jonathan Karlen"
Дата:
Сообщение: Accent Marks