Created
August 18, 2011 18:48
-
-
Save williamjacksn/1154822 to your computer and use it in GitHub Desktop.
Rainwave SQL / All albums with number of songs and total song length
This file contains hidden or 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 | |
rw_albums.sid, | |
album_name, | |
count(song_id) as num_songs, | |
sum(song_secondslong) as total_song_length | |
from | |
rw_albums | |
join | |
rw_songs using (album_id) | |
where | |
rw_albums.sid < 5 and | |
song_verified is true | |
group by | |
rw_albums.sid, | |
album_name | |
order by | |
album_name, | |
rw_albums.sid; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment