Re: Sorting by constant values

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: robert(at)webtent(dot)com
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sorting by constant values
Date: 2005-05-03 17:53:19
Message-ID: 1115142799.13303.1502.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2005-05-03 at 12:29, Robert Fitzpatrick wrote:
> I have a column that I want to sort by certain values. The values are
> Unit, Exterior and Common. I want all the records with Unit first,
> Common second and Exterior last in the sort order. These are the only 3
> possible values, is there a way to sort manually like that with the
> alphanumeric values?

case statement should work.

http://www.postgresql.org/docs/8.0/static/functions-conditional.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar Hafstað 2005-05-03 18:08:30 Re: Date addition/subtraction
Previous Message Scott Marlowe 2005-05-03 17:52:12 Re: Date addition/subtraction