title: Subtract two query results in mySQL
body: <p>I have 2 queries which gives all records(including the booked ones) and gives out booked records only. I wanted to subtract the two tables so that it only shows the unbooked records, here are the example of the query results:</p>
  
  <p>Query 1:</p>
  
  <pre><code>+--------+--------+
  | Number | AreaNo | 
  +--------+--------+ 
  |      6 |      A |  
  |      6 |      B |  
  |      6 |      C |  
  |      7 |      A | 
  |      7 |      B | 
  +--------+--------+
  </code></pre>
  
  <p>Query 2:</p>
  
  <pre><code>+--------+--------+
  | Number | AreaNo | 
  +--------+--------+ 
  |      6 |      B |  
  |      6 |      C |   
  |      7 |      B | 
  +--------+--------+
  </code></pre>
  
  <p>Desired Results:</p>
  
  <pre><code>+--------+--------+
  | Number | AreaNo | 
  +--------+--------+ 
  |      6 |      A |  
  |      7 |      A | 
  |      7 |      C | 
  +--------+--------+
  </code></pre>
  
  <p>I know that I can't use MINUS in mySQL but I'm not sure that LEFT JOIN works in this situation. If this doesn't work, is it possible to work on the where clause?(Like if the number match, it only clear out the one with matching AreaNo). I tried this with two AND clause and it doesn't work. It clears out the results that doesnt fit either criteria. I have been doing researches over a week and nothing works. Please help, I am  really desperated.</p>
  
  <p>Query 1:</p>
  
  <pre><code>SELECT bookingListNo,
         areaNo 
    FROM BookingList, 
         BookingArea, 
         BookingLocation 
   WHERE bookingListNo NOT IN (SELECT bookingListNo 
                                 FROM Booking 
                                WHERE bookingAreaNo IS NULL) AND 
         BookingList.bookingLocationNo = BookingLocation.bookingLocationNo AND
         BookingLocation.BookingLocationNo = BookingArea.bookingLocationNo 
  </code></pre>
  
  <p>Query 2:</p>
  
  <pre><code>SELECT bookingListNo, 
         areaNo 
    FROM Booking, 
         BookingArea 
   WHERE Booking.bookingAreaNo = BookingArea.bookingAreaNo
  </code></pre>