You are here: subquery and LIMIT « PHP SQL « IT news, forums, messages
subquery and LIMIT

Posted by persh on 04/22/06 09:18

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация