title

0

Please login or register to vote for this query.

(click on this box to dismiss)

Russian Language

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'
from 
  (select userid, count(postid) as 'no_posts'
  from comments
  where year(creationdate) = 2021
  group by userid) c ) d
 


/*
 select a.userid, a.last_post, b.text
 from 
 (select userid, max(creationdate) as 'last_post'
 from comments 
 group by userid) as a
 join comments as b
 on 
 a.userid = b.userid
 and a.last_post = b.creationdate
 order by last_post desc

Enter Parameters

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