I am stuck on creating a query.
I got a table "videos" with this structure:
id | artist | song | hits
1 | Rihanna | Song1 | 400
2 | Rihanna | Song2 | 100
3 | Prince | Song45 | 300
4 | The Police | Song456 | 1000
SELECT DISTINCT artist, SUM(hits)
ORDER BY hits DESC
Rihanna | 1800
Rihanna | 500
Prince | 300
The Police | 1000
SELECT artist, SUM(hits) as hitscount FROM videos GROUP BY artist ORDER BY hitscount DESC
added suggestions from the comments. thanks!