 <p>I think this is what you're after:</p> <pre><code>SELECT AVG(items.price) FROM (SELECT t.price FROM TABLE t WHERE t.price &gt; '0' AND t.item_id = '$id' ORDER BY t.price LIMIT 5) items </code></pre> <p>It will return the average of the 5 lowest prices - a single answer.</p>