order by desc - with zeros on top - Mailing list pgsql-novice

From Christoph Frick
Subject order by desc - with zeros on top
Date
Msg-id 20060613152912.GV31952@byleth.sc-networks.de
Whole thread Raw
Responses Re: order by desc - with zeros on top  (Michael Glaesemann <grzm@seespotcode.net>)
List 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

Attachment

pgsql-novice by date:

Previous
From: Tom Allison
Date:
Subject: ruby
Next
From: Michael Glaesemann
Date:
Subject: Re: order by desc - with zeros on top