title: MySQL Join and Count query
body: <p>I have two MySQL tables structed as follows;</p>
  
  <p>advert</p>
  
  <pre><code>+-------------------+--------------+
  | Field             | Type         |
  +-------------------+--------------+
  | id                | int(11)      |
  | title             | varchar(150) |
  +-------------------+--------------+
  </code></pre>
  
  <p>advert_interest_record</p>
  
  <pre><code>+--------------+------------+
  | Field        | Type       |
  +--------------+------------+
  | id           | int(11)    | 
  | advert_id    | int(11)    |
  | message      | longtext   |
  +--------------+------------+
  </code></pre>
  
  <p>I want to select a list of all records from the "advert" table - and get the number of rows from the "advert_interest_record" table where advert.id=response.advert_id. </p>
  
  <p>The SQL I'm using to join the tables is as follows;</p>
  
  <pre><code>SELECT advert.id, advert.title 
  FROM advert 
  LEFT JOIN advert_interest_record ON advert.id = advert_interest_record.advert_id  
  GROUP BY advert_interest_record.advert_id 
  </code></pre>
  
  <p>The first problem I've got is that when there are no records in the "advert_interest_record" table, the record from the "advert" table isn't included in the result - and I need it to be.</p>
  
  <p>My second question is, how would I go about counting the rows in the "advert_interest_record" table?</p>
  
  <p>Any advice on this would be appreciated. </p>
  
  <p>Thanks.</p>