Ordering by a complex field - Mailing list pgsql-general

From Robert James
Subject Ordering by a complex field
Date
Msg-id e09785e00707181812l628f1634j163a4190111dc73a@mail.gmail.com
Whole thread Raw
Responses Re: Ordering by a complex field  (Michael Glaesemann <grzm@seespotcode.net>)
List pgsql-general
I have a one varchar field.

I'd like to order so that records where field='2' come first, then '1', then '9', then anything but '0', then '0'.  Is there anyway to do this in a standard order by clause (that is, without writing a new SQL function)?

pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: tsearch2 on postgres8.2.4
Next
From: Michael Glaesemann
Date:
Subject: Re: Ordering by a complex field