title: mysql- get number of occurrences
body: <p>Hi i am trying to get a mysql query working and need some help. I have 2 tables (staff, booking).</p>
  <p>Staff table contains staff details</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>StaffID</th>
  <th>First_name</th>
  <th>Last_name</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>John</td>
  <td>Doe</td>
  </tr>
  <tr>
  <td>2</td>
  <td>Mary</td>
  <td>Doe</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Booking table contains</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>BookingID</th>
  <th>StaffID</th>
  <th>Status</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>1</td>
  <td>cancelled</td>
  </tr>
  <tr>
  <td>2</td>
  <td>1</td>
  <td>cancelled</td>
  </tr>
  <tr>
  <td>3</td>
  <td>1</td>
  <td>confirmed</td>
  </tr>
  <tr>
  <td>4</td>
  <td>2</td>
  <td>cancelled</td>
  </tr>
  <tr>
  <td>5</td>
  <td>1</td>
  <td>confirmed</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I would like to get the count of confirmed/cancelled bookings for each staff but is having trouble getting it to work. My current query that I'm using is</p>
  <pre><code>Select staff.StaffID, staff.First_name, staff.Last_name, sum(booking.Status LIKE '$status') as Status 
  from staff, booking 
  where staff.StaffID = booking.ConvenerID 
  group by staff.StaffID
  </code></pre>
  <p><code>$status</code> being <code>cancelled</code> or <code>confirmed</code>. With this query I'm only able to display a row if there is a status value, if a staff have no cancelled it does not display the row for that staff. How can I get the row to display even if the count of <code>$status</code> is <code>0</code>.</p>