Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
363 B
1
Indexable
Never
p.name AS playlist_name,
SUM(inv.total) AS total_revenue
FROM track AS t
INNER JOIN invoice_line AS i ON t.track_id=i.track_id
INNER JOIN playlist_track AS pl ON t.track_id=pl.track_id
INNER JOIN playlist AS p ON pl.playlist_id = p.playlist_id
INNER JOIN invoice AS inv ON inv.invoice_id = i.invoice_id
GROUP BY  playlist_name
ORDER BY  total_revenue DESC