title: MYSQL: write insert query based on first column value repeated in second column
body: <p>I have following table and I would like to compose 'insert' query to find how many connections are there for mod.</p>
  
  <pre><code>id  mod     modele  
  90  act     gend    
  22  act     gend    
  54  act     ent     
  53  act     ent     
  95  act     genext
  61  act     ent
  </code></pre>
  
  <p>I want to write a query to insert the above in below format</p>
  
  <pre><code>id  Mod     ConnMod     noConn
  1   act     gend        2
  2   act     ent         3
  3   act     genext      1
  </code></pre>
  
  <p>Please help me.</p>