Skip to content

Instantly share code, notes, and snippets.

@hokaccha
Created February 4, 2017 12:26
Show Gist options
  • Save hokaccha/e128e1c3a68527ebf2c50d5e95a089b1 to your computer and use it in GitHub Desktop.
Save hokaccha/e128e1c3a68527ebf2c50d5e95a089b1 to your computer and use it in GitHub Desktop.
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
Display the source blob
Display the rendered blob
Raw
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