Create a gist now

Instantly share code, notes, and snippets.

@hokaccha /query.sql Secret
Created Feb 4, 2017

Adventar posted entry rate
select
year
, entry_count
, posted_url_count
, round(100.0 * posted_url_count / entry_count, 2) as rate
from (
select
extract(year from date) as year
, count(*) as entry_count
, count(case when url != '' then 1 end) as posted_url_count
from entries
group by 1
) t
order by
1
;
year entry_count posted_url_count rate
2012 793 746 94.07
2013 3827 3346 87.43
2014 5201 4622 88.87
2015 8505 7346 86.37
2016 9261 7922 85.54
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment