subquery and LIMIT

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
BY [ Sa, 22 April 2006 08:18 ] [ ID #1285368 ]

Re: subquery and LIMIT

Would it work to reverse the query, so left join p on c?
zac.carey [ Sa, 22 April 2006 14:19 ] [ ID #1285369 ]
PHP » alt.php.sql » subquery and LIMIT

Vorheriges Thema: mysql UPDATE syntax
Nächstes Thema: order by