title: MySQL - conditional SELECT
body: <p>I have tables <code>item</code> and <code>store</code> (it's a store management system). <code>item</code> table has a column called <code>store_id</code> and another column called <code>status</code>. <code>item.status</code> can be 'sold' or 'unsold'.</p>
  
  <p>I need help writing a query which will do these things:</p>
  
  <ul>
  <li>select all items of all stores</li>
  <li>if a store has just one item and that item is 'sold', remove that item from the result set</li>
  </ul>
  
  <p>Thanks in advance!</p>