Re: order by question

From: Sergio Gabriel Rodriguez <sgrodriguez(at)gmail(dot)com>
To: Tony Liao <tonyliao(at)yuehetone(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: order by question
Date: 2009-06-19 14:26:45
Message-ID: 15aa6b3e0906190726k51ebc64el34a12d4fd20b11e1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, Jun 19, 2009 at 6:50 AM, Tony Liao <tonyliao(at)yuehetone(dot)com> wrote:
Hi,All
for example,I have a query as this
select id,product_id from table_name where product_id in
(6,3,4,10,7) order by .....
the results I want to get as bellow:
id................product_id......................
33...............6...................................
40...............6..................................
12...............3....................................
25...............4.................................
10...............4................................
17...............10.................................
43................7...................................

any Idea? thanks

--
Tony Liao

I suppose you want order by IN condition "(6,3,4,10,7)" (?)

Sergio Gabriel Rodriguez
http://www.3trex.com.ar

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kenny W Drobnack 2009-06-19 14:39:55 Re: order by question
Previous Message Tino Schwarze 2009-06-19 12:10:13 Re: order by question