284 B · 7 lines · Created 10mo ago
SQL
1234567SELECT a.id, a.name, a.genres,COUNT(*) AS play_count,COUNT(DISTINCT s.user_id) AS unique_listenersFROM artists aLEFT JOIN scrobbles s ON s.artist_id = a.idWHERE genres IS NOT NULL AND array_length(genres, 1) > 0 GROUP BY a.id, a.name, a.genresORDER BY play_count DESC LIMIT 200;