Created
March 30, 2010 20:25
-
-
Save mbklein/349553 to your computer and use it in GitHub Desktop.
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 'flag:' || lower(sc.code) || ':' || sc.name, | |
d.downloads, (d.downloads/t.total)*100 | |
from (select country_code,sum(relative_value) as downloads from stats.download_country_month | |
where year=? | |
group by country_code) as d, | |
stats.country sc, | |
(select sum(relative_value::real) as total from stats.download_month | |
where year=?) as t | |
where d.country_code = sc.code | |
order by d.downloads desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment