> 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
>
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
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
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
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..
..
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
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
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.
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.