title: How to display how many times each records in a table used by other table
body: <p>I have a problem with my query, below are two tables that <strong>tbl_tag</strong> and <strong>tbl_tag_usedby</strong>. I want to show how much of each record in <strong>tbl_tag</strong> used by record in <strong>tbl_tag_usedby</strong>. </p>
  
  <p><img src="https://i.stack.imgur.com/GwgGU.jpg" alt="enter image description here"></p>
  
  <p>Here is a query that I use:</p>
  
  <pre><code>SELECT t.*, COUNT(u.tagid) AS totale FROM tbl_tag t LEFT JOIN tbl_tag_usedby u ON u.tagid = t.id AND t.status =1 GROUP BY u.tagid
  </code></pre>
  
  <p>and the results are as below:</p>
  
  <p><img src="https://i.stack.imgur.com/pNbBD.jpg" alt="enter image description here"></p>
  
  <p>In this case the record id from 2 to 6 do not appear in the query results, I want record id from 2 to 6 are also shown and on the field "totale" its value is 0.</p>
  
  <p>Can anyone help me?</p>