I have this query:
SELECT count(cp.CxID) as intSmokers FROM CustPrimarySmoking cp JOIN Customer c ON cp.CxID = c.CustomerID WHERE cp.CxID IN (SELECT CxID
You can also double-nest the inner query to get around this restriction, see:
Mysql delete statement with limit