Re: [ADMIN] order by question

2009-07-06 Thread Harald Fuchs
> I agree with Scott, if your application generate IN condition, could create > CASE too, looks like this > SELECT id, product_id FROM your_table >    WHERE product_id IN (6, 3, 4, 10, 7) >     ORDER BY >   CASE >     WHEN product_id = 6  THEN 1 >     WHEN product_id = 3  THEN 2 >    

Re: [ADMIN] order by question

2009-07-05 Thread Sergio Gabriel Rodriguez
On Fri, Jun 19, 2009 at 10:46 PM, Scott Marlowe wrote: > On Fri, Jun 19, 2009 at 7:32 PM, Tony Liao wrote: > > Thanks,All, > > To Tino,I want to order by IN condition "(6,3,4,10,7)". > > To Sergio,my answer is "Yes". > > To Kenny,I think this is not the result I want to

Re: [ADMIN] order by question

2009-06-19 Thread Scott Marlowe
On Fri, Jun 19, 2009 at 7:32 PM, Tony Liao wrote: > Thanks,All, >          To Tino,I want to order by IN condition "(6,3,4,10,7)". >          To Sergio,my answer is "Yes". >          To Kenny,I think this is not the result I want to get. >          To Scott,In database,there are thousands of  produ

Re: [ADMIN] order by question

2009-06-19 Thread Tony Liao
Thanks,All, To Tino,I want to order by IN condition "(6,3,4,10,7)". To Sergio,my answer is "Yes". To Kenny,I think this is not the result I want to get. To Scott,In database,there are thousands of products.the select query is generated by application,and it is no

Re: [ADMIN] order by question

2009-06-19 Thread Scott Marlowe
On Fri, Jun 19, 2009 at 3:50 AM, Tony Liao 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: > idproduct_id..

Re: [ADMIN] order by question

2009-06-19 Thread Kenny W Drobnack
.. From: pgsql-admin-ow...@postgresql.org [mailto:pgsql-admin-ow...@postgresql.org] On Behalf Of Tony Liao Sent: Friday, June 19, 2009 5:50 AM To: pgsql-admin@postgresql.org Subject: [ADMIN] order by question Hi,All for example,I have a query as this select id,p

Re: [ADMIN] order by question

2009-06-19 Thread Sergio Gabriel Rodriguez
On Fri, Jun 19, 2009 at 6:50 AM, Tony Liao 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: idproduct_id.. 33

Re: [ADMIN] order by question

2009-06-19 Thread Tino Schwarze
On Fri, Jun 19, 2009 at 05:50:25PM +0800, Tony Liao 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: > idproduct_id.

[ADMIN] order by question

2009-06-19 Thread Tony Liao
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: idproduct_id.. 33...6... 40.