title: Only show rows where mysql subquery returns null
body: <p>I am trying to query a receipts table, to pull order numbers from a database who's first transaction falls within a certain time range. Here is what I have so far:</p>
  
  <pre><code>SELECT id, order_number, 
  (
    SELECT id FROM receipts 
    WHERE received &lt; r.received AND order_number = r.order_number 
    LIMIT 1
  ) priorPayment 
  FROM receipts r 
  WHERE received &gt; 1416384000 AND received &lt; 1416470399 
  ORDER BY id DESC
  </code></pre>
  
  <p>This works fine except I want to filter out anything that has a priorPayment returned (so only show where this subquery returns null) right now it returns everything. Any suggestions?</p>