Ordering returned rows according to a list

From: Sebastian Tennant <sebyte(at)smolny(dot)plus(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Ordering returned rows according to a list
Date: 2008-12-22 17:20:10
Message-ID: iqpcnn3p.fsf@vps203.linuxvps.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I'd like to make a single query that returns a number of rows using a
'WHERE id IN (<list-of-ids>)' condition, but I'd like the rows to be
returned in the order in which the ids are given in the list.

Is this possible?

Sebastian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message paulo matadr 2008-12-22 17:22:38 Erro in vaccum
Previous Message Erik Jones 2008-12-22 17:10:58 Re: lack of consequence with domains and types