Re: ORDER BY 'DK', 'DE', DESC?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Victor Spång Arthursson <scooterbabe(at)home(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ORDER BY 'DK', 'DE', DESC?
Date: 2004-05-20 17:20:44
Message-ID: 20040520101818.E17153@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 11 May 2004, [ISO-8859-1] Victor Spång Arthursson wrote:

> Hi!
>
> I would like to know if it's possible to give a priority order of how
> to sort the returning rows?
>
> Like for example to order every row with a field language = DK first,
> then the rows with field language = *DE' and last the other languages,
> ordered alphabetically…?

Well, I think you can do something like:

ORDER BY (language = 'DK'), (language = 'DE'), language

(or you could possibly condense the first two into one with case)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Ruth 2004-05-20 18:02:00 Re: ORDER BY 'DK', 'DE', DESC?
Previous Message Tom Lane 2004-05-20 16:13:28 Re: backend terminated abnormally