title: Alphabetical Order in SQL using Group By and Order By
body: <p>I've a problem with my SQL. My statement is following:</p>
  
  <pre><code>SELECT       p.id,p.nombre 
  FROM         provincia p 
  INNER JOIN   informacion_tiendas it ON p.id=it.idprovincia 
  GROUP BY     p.id 
  ORDER BY     COUNT(p.id) DESC,p.nombre ASC
  </code></pre>
  
  <p>I need the next order: first the elements that have more data and order by name, but this SQL give me the next order (I'm ordering some countries with shop):</p>
  
  <p>Málaga - Madrid (these two are ok) - Ávila - A Coruña - Almería (these three are wrong)</p>
  
  <p>when the order must be</p>
  
  <p>Málaga - Madrid - A Coruña - Almería - Ávila</p>
  
  <p>Where is the mistake in my SQL statement?</p>