title: track multiple identical entries
body: <p>I got a table that I am allowing identical entries (duplicates, triplecates etc.) but I also got a column that I want everytime that an entry is being made to be updated with the how many times that entry exists.</p>
  
  <p>So I thought to write a trigger, I can already find the duplicate entries by doing </p>
  
  <pre><code>select count(pid) from items group by pid having count(*);
  </code></pre>
  
  <p>but the thing is that this query returns less columns that the orinal table (cause there are many duplicates) </p>
  
  <p>so there is no 1 to 1 relation between the query and the table so I can use update. How could I modify this to get the desired result</p>
  
  <p>thank you in advanced.</p>