 <p>You probably want to do a <code>LEFT JOIN</code> and a <code>GROUP_CONCAT</code> and <code>HAVING</code> to get the info you are looking for:</p> <pre><code>SELECT i.id, i.title, GROUP_CONCAT( l.stockcode SEPARATOR ',' ) extras FROM items i LEFT JOIN ledger l ON i.id = l.itemid WHERE i.id = 123 HAVING SUM(l.qty) &gt; 0 </code></pre> <p>See this <a href="http://sqlfiddle.com/#!2/4db68/4" rel="nofollow">SQL Fiddle</a></p>