# Posts Read Percentiles

**URL:** https://meta.discourse.org/t/posts-read-percentiles/275134
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [May 1, 2016, 5:00am UTC](https://meta.discourse.org/t/posts-read-percentiles/275134 "2016-05-01T05:00:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [May 1, 2016, 5:00am UTC](https://meta.discourse.org/t/posts-read-percentiles/275134/1 "2016-05-01T05:00:00Z")

</div>

### Posts Read Percentiles

Number of posts read for users in each percentile

```sql
with tentiles as (
    select posts_read_count as read, 
    ntile(10) 
    over (order by posts_read_count) as tentile 
    from user_stats
)
select (tentile - 1) * 10 as percentile,
    min(read) as min_posts_read, 
    max(read) as max_posts_read
from tentiles
group by tentile
order by tentile desc

```
