Re: Sorting by constant values

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: robert(at)webtent(dot)com
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sorting by constant values
Date: 2005-05-03 18:14:04
Message-ID: 1115144044.4196.52.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2005-05-03 at 13:29 -0400, 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?

... ORDER BY length(col);

:-)
gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2005-05-03 18:25:04 Re: MVCC and insert
Previous Message Ragnar Hafstað 2005-05-03 18:08:30 Re: Date addition/subtraction