OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: workaround? : Limit in subquery not allowed

From: Perrin Harkins (perrinelem.com)
Date: Wed Feb 06 2008 - 08:08:07 CST


On Feb 6, 2008 6:40 AM, Britske <gbritsgmail.com> wrote:
> SELECT * FROM prices WHERE prices.productid IN (SELECT id FROM priducts
> ORDER BY id LIMIT 0, 1000)
>
> However, I'm getting an error-message stating that Limit is not allowed in a
> subquery.
> How would you approach this?

SELECT *
FROM prices
JOIN (SELECT id FROM products ORDER BY id LIMIT 0, 1000) AS products
ON (prices.productid = products.id)

- Perrin

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql