Q&A about the site for science fiction and fantasy enthusiasts
/*decile of posts count by user_id
select userid, ntile(10) over (order by no_posts)
(select top(100) userid, count(postid) as 'no_posts'
where year(creationdate) = 2021
group by userid
order by count(creationdate) desc) a
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