subquery and LIMIT

subquery and LIMIT

am 22.04.2006 08:18:09 von BY

MySQL version : 5.0.18

I have the following query:

select p.products_id products p where p.products_id in (select
c.anonymous_id from c1 c order by c.satisfaction DESC LIMIT 5);

According to my version of MySQL I can't use LIMIT in the subselect. Is
there another way I can limit the number of lines returned from my subselect
? I need to cut the number of lines at the subselect level because the order
is based on the field satisfaction (I want the top 5 entries based on
satisfaction) which is not available in the products table.

Any help would be appreciated

Re: subquery and LIMIT

am 22.04.2006 14:19:58 von zac.carey

Would it work to reverse the query, so left join p on c?