Re: An order by question - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: An order by question
Date
Msg-id 20040201121112.C18549@quality.qadas.com
Whole thread Raw
In response to Re: An order by question  (Tomasz Myrta <jasiek@klaster.net>)
List pgsql-sql
On Sun, Feb 01, 2004 at 06:22:30PM +0100, Tomasz Myrta wrote:
> Dnia 2004-02-01 14:34, U¿ytkownik Michael Fuhr napisa³:
> > SELECT *
> > FROM records
> > ORDER BY lastName,
> >          firstName,
> >          SUBSTRING(term FROM 1 FOR 4),
> >          CASE SUBSTRING(term FROM 5)
> >            WHEN 'S' THEN 1
> >            WHEN 'X' THEN 2
> >            ELSE 3
> >          END;
> 
> or the easier one:
> 
> order by lastname,firstname, translate(term,'SXF','123');

Blast...I just *knew* I was missing an easy, obvious solution.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-sql by date:

Previous
From: "Carla Mello"
Date:
Subject: Executing dynamic queries (EXECUTE)
Next
From: Tomasz Myrta
Date:
Subject: Re: Executing dynamic queries (EXECUTE)