1
0
dwelling-radio/internal/statistics/db/sqlite/queries/most_popular_songs.sql

10 lines
219 B
MySQL
Raw Normal View History

SELECT
`artist`,
`title`,
SUM(`listeners`) AS `most_listeners`
FROM `history`
LEFT JOIN `song`
ON `song`.`song_id` = `history`.`song_id`
GROUP BY `song`.`song_id`
ORDER BY `most_listeners` DESC
LIMIT ?;