 <p>Try to use a subquery with a LIMIT clause, e.g. -</p> <pre><code>SELECT i_s.pid, p_r.range_id as PriceRangeID, COUNT(p_r.range_id) as PriceGroupTotal FROM (SELECT * FROM indx_search WHERE i_s.word = 'memory' ORDER BY i_s.pid ASC LIMIT 0 , 20) i_s LEFT JOIN windex_mem w_m ON w_m.word = i_s.word LEFT JOIN price_range p_r ON p_r.pid = i_s.pid GROUP BY i_s.pid, PriceRangeID </code></pre>