Q&A for students, teachers, and linguists wanting to discuss the finer points of the Russian language
/*decile of posts count by user_id
select * from
(select userid, ntile(10) over (order by no_posts) as 'deciles'
(select userid, count(postid) as 'no_posts'
where year(creationdate) = 2021
group by userid) c ) d
select a.userid, a.last_post, b.text
(select userid, max(creationdate) as 'last_post'
group by userid) as a
join comments as b
a.userid = b.userid
and a.last_post = b.creationdate
order by last_post desc