1SELECT a.id, a.name, a.genres,
2COUNT(*) AS play_count,
3COUNT(DISTINCT s.user_id) AS unique_listeners
4FROM artists a
5LEFT JOIN scrobbles s ON s.artist_id = a.id
6WHERE genres IS NOT NULL AND array_length(genres, 1) > 0 GROUP BY a.id, a.name, a.genres
7ORDER BY play_count DESC LIMIT 200;