Created
February 23, 2012 13:34
-
-
Save williamjacksn/1892862 to your computer and use it in GitHub Desktop.
Rainwave SQL / All songs with cooldown group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
min(rw_songs.sid) as "Channel ID", | |
min(album_id) as "Album ID", | |
min(album_name) as "Album Title", | |
song_id as "Song ID", | |
min(song_title) as "Song Title", | |
array_agg(artist_name) as "Artist", | |
oac_name as "Cooldown Group", | |
min(song_rating_avg) as "Average Rating", | |
timestamp with time zone 'epoch' + min(song_addedon) * interval '1 second' as "Song Added On" | |
from | |
rw_songs | |
join | |
rw_albums using (album_id) | |
join | |
rw_song_artist using (song_id) | |
join | |
rw_artists using (artist_id) | |
left join | |
rw_song_oa_cat using (song_id) | |
left join | |
rw_oa_categories using (oac_id) | |
where | |
song_verified is true | |
group by | |
song_id, | |
oac_name | |
order by | |
"Channel ID", | |
"Album Title", | |
song_id, | |
"Song Title"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment