Median views per day

0

Please login or register to vote for this query.

(click on this box to dismiss)

Psychology & Neuroscience Meta

Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

with
  views_per_day as (
    select
      cast(viewcount as float) / datediff(day, creationdate, GetDate()) as vpd
    from
      posts
    where
      posttypeid = 1
  ),
  stats As (
    select
      percentile_disc(0.5)
          within group (order by vpd)
          over (partition by 1) 
        as median_views_per_day
    from
      views_per_day
  )
select
  median_views_per_day
from
  stats
group by median_views_per_day;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results