scrobbles-by-genre.sql
12 lines 311 B view raw
1SELECT 2 t.xata_id, 3 t.title, 4 t.artist, 5 t.album, 6 s.timestamp 7FROM scrobbles s 8LEFT JOIN tracks t ON t.xata_id = s.track_id 9LEFT JOIN albums al ON s.album_id = al.xata_id 10LEFT JOIN artists ar ON ar.xata_id = s.artist_id 11WHERE ar.genres @> ARRAY['drill'] 12ORDER BY s.timestamp DESC LIMIT 40;