title: max count together in an sql query 2
body: <p>This is referring to the question i asked before, and got a really quick answaer (<a href="https://stackoverflow.com/questions/751156/max-count-together-in-an-sql-query">max count together in an sql query</a>). The Problemset is similar, but the solution in the prevous question would force me to access a db in a loop which will cause performance problems. So what i have now, after some joins is:</p>
  
  <pre><code>    id | description
       0 | bla
       0 | blub
       0 | bla
       1 | blablub
       1 | bla
     ... | ...
  </code></pre>
  
  <p>As u can see, now the id is not a primary key anymore. What i want is to get the most used description for each id in the resultset. It should look something like this:</p>
  
  <pre><code> id | most_popular_description | times_the_desc_appeared_for_an_id
    0 |                      bla |                                 2
    1 |                  blablub |                                 1
  ... |                      ... |                               ...
  </code></pre>