Re: Problem of Null Ordering

Поиск
Список
Период
Сортировка
От Dennis Björklund
Тема Re: Problem of Null Ordering
Дата
Msg-id Pine.LNX.4.44.0212031028380.9578-100000@zigo.dhs.org
обсуждение исходный текст
Ответ на Problem of Null Ordering  (Harry Yau <harry.yau@regaltronic.com>)
Список pgsql-general
On Tue, 3 Dec 2002, Harry Yau wrote:

> NULL will come after the row that have a number value. I am wondering is
> there anything I can do to make the row with Null value come before the
> row with a number value.

I don't know of such a setting. I have however a workaround that you can
apply to the order by clause. If b is the column that contains NULL values
that you want to order by, then you can instead order in this way:

ORDER BY b IS NULL DESC, b

(or ORDER BY b IS NOT NULL, b)

which will give you the NULL values first. It's probably not standard SQL.

ps. Why post to several lists?

--
/Dennis


В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Christian Imbeault
Дата:
Сообщение: Re: Problem of Null Ordering
Следующее
От: Harry Yau
Дата:
Сообщение: Re: Problem of Null Ordering