How to SORT results made with COUNT?


I have to choose artists with biggest number of songs from DB.

To count the number of songs for each artist I use this query:

SELECT artis, COUNT(song) FROM lyric GROUP BY artis LIMIT 0,100;

I wonder is it possible to sort results by number of songs in the same MySQL query? Or I should use other methods to sort results?

of course it’s possible :slight_smile:

SELECT artis
     , COUNT(*) [COLOR="Blue"]AS songs[/COLOR]  FROM lyric 
    BY artis 
    BY [COLOR="blue"]songs [/COLOR]DESC LIMIT 0,100

Niiice :slight_smile:

Thanks a LOT.