title: Count duplicates records in Mysql table?
body: <p>I have table with, folowing structure. </p>
  
  <p>tbl </p>
  
  <pre><code>id   name  
  1    AAA
  2    BBB
  3    BBB
  4    BBB
  5    AAA
  6    CCC
  
  select count(name) c from tbl
  group by name having c &gt;1
  </code></pre>
  
  <p>The query returning this result:</p>
  
  <pre><code>AAA(2)  duplicate
  BBB(3)  duplicate
  CCC(1)  not duplicate
  </code></pre>
  
  <p>The names who are duplicates as AAA and BBB. The final result, who I want is count of this duplicate records.</p>
  
  <p>Result should be like this:
       Total duplicate products (<strong>2</strong>)</p>