order by desc - with zeros on top

From: Christoph Frick <frick(at)sc-networks(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: order by desc - with zeros on top
Date: 2006-06-13 15:29:13
Message-ID: 20060613152912.GV31952@byleth.sc-networks.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message kynn 2006-06-13 16:11:41 SQL for removing duplicates?
Previous Message Maurice Breeman 2006-06-13 14:02:36 Calculate difference between rows.