Is it possible to make the order of output the same as the order of input parameters?

From: "m(dot) hvostinski" <makhvost(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Is it possible to make the order of output the same as the order of input parameters?
Date: 2010-06-01 22:16:06
Message-ID: AANLkTin1qnRa4Bowqcj-4RzEos-Jt2ITkc25kRbz8AZd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a simple query like:

SELECT * FROM customer WHERE id IN (23, 56, 2, 12, 10)

The problem is that I need to retrieve the rows in the same order as the set
of ids provided in the select statement. Can it be done?

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2010-06-01 23:36:58 Re: What Linux edition we should chose?
Previous Message Tom Lane 2010-06-01 21:49:42 Re: PosttgreSQL on AIX