title: How to get latest value of child table (with a condition) using parent table primary key
body: <p>I have two tables one for hotel booking and another for booking status with values (Booked, Cancelled, Noshow). I need get the cancelled booking rows how to frame query in mysql</p>
  
  <p>(note : initial status is booked if that booking is cancelled one new row added with the status as cancelled )</p>
  
  <p>Table 1 - bookings</p>
  
  <p>id  |   bookingNumber   |   check in    |   check out   |   rooms   </p>
  
  <p>1   |   BK01    |           2018-06-23   |  2018-06-24  |   1<br>
  2   |   BK02    |           2018-06-23   |  2018-06-24  |   3</p>
  
  <p>Table 2 - Status</p>
  
  <p>id   |    bookingNumber      |     Status</p>
  
  <p>1    |    BK01         |       Booked</p>
  
  <p>2    |    BK01         |       Cancelled</p>
  
  <p>3    |    BK02         |       Booked</p>
  
  <p>Expected answer: 
  (Need only cancelled booking)
  id  |  bookingNumber  |  checkin  |  checkout  |  rooms  |  status
  1   |  BK01           | 2018-06-23| 2018-06-24 |   1     |  Cancelled</p>