10 lines
219 B
MySQL
10 lines
219 B
MySQL
|
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 ?;
|