title: Select top distinct results ordered by frequency
body: <p>My table has two columns: id and name. The data looks like this:</p>
  
  <pre><code>id | name
  ----------
  1    Jeff
  2    Sam
  3    Carl
  4    Sam
  5    Carl
  6    Jeff
  7    Dave
  8    Jeff
  </code></pre>
  
  <p>What I want to obtain is this:</p>
  
  <pre><code>name | frequency
  ----------------
  Jeff      3
  Carl      2
  Sam       2
  Dave      1
  </code></pre>
  
  <p>Essentially, I need an SQL query that counts the unique names within the table, and sorts them by their frequnecy. I'm using MySQL if it matters.</p>
  
  <p>Thank-you.</p>