List:General Discussion« Previous MessageNext Message »
From:Perrin Harkins Date:February 6 2008 2:08pm
Subject:Re: workaround? : Limit in subquery not allowed
View as plain text  
On Feb 6, 2008 6:40 AM, Britske <gbrits@stripped> 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
Thread
workaround? : Limit in subquery not allowedBritske6 Feb
  • Re: workaround? : Limit in subquery not allowedBaron Schwartz6 Feb
  • Re: workaround? : Limit in subquery not allowedPerrin Harkins6 Feb