[SQL] ORDER records based on parameters in IN clause

2005-07-13 Thread Riya Verghese
Thanks! This worked beautifully.   Here’s what I have: SELECT a.listing_ id FROM cls.listings  a JOIN (SELECT listing_id,count(listing_id) AS count FROM cls.tagslistings  WHERE    cust_id =27 AND tag_id IN (SELECT tag_id FROM cls.tags WHERE tag_name IN ('toys','263')) GROUP BY lis

[SQL] ORDER records based on parameters in IN clause

2005-06-27 Thread Riya Verghese
I have a stmt where the outer-query is limited by the results of the inner query. I would like the outer query to return records in the same order as the values provided in the IN clause (returned form the inner query). The inner_query is returning id’s ordered by count(id) , i.e by most