order by desc - with zeros on top

Поиск
Список
Период
Сортировка
От Christoph Frick
Тема order by desc - with zeros on top
Дата
Msg-id 20060613152912.GV31952@byleth.sc-networks.de
обсуждение исходный текст
Ответы Re: order by desc - with zeros on top  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-novice
hiho

IIRC there where recently a sql code snippet, that solved the problem of
"ordering a list of ints descending - but keep the zero on top":

e.g.:

 shown_production_id
---------------------
                   0
                   0
               20270
               20258
                 901
                 900

if there is no easy way or may memory plays tricks on me: dont bother
with this! i can solve it easily in the app - but why put work where the
dbs can already fix it.

--
cu

Вложения

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

Предыдущее
От: Tom Allison
Дата:
Сообщение: ruby
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: order by desc - with zeros on top