From: Michael Fuhr <mike@fuhr.org>
To: Tomasz Myrta <jasiek@klaster.net>
Cc: darnold@northcoast.com
Cc: pgsql-sql@postgresql.org
Subject: Re: An order by question
Date: Sun, 1 Feb 2004 12:11:12 -0700
Message-ID: <20040201121112.C18549@quality.qadas.com> (raw)
In-Reply-To: <401D35D6.2020902@klaster.net>
References: <20040201133451.GA13002@winnie.fuhr.org>
<401D35D6.2020902@klaster.net>
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mike@fuhr.org, jasiek@klaster.net, darnold@northcoast.com
Subject: Re: An order by question
In-Reply-To: <20040201121112.C18549@quality.qadas.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox