Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group