Get Top Users for Snowflake-datawarehouse


Please login or register to vote for this query.

(click on this box to dismiss)



-- Top users per tag

declare @limit int = 200;
declare @tag_name nvarchar(35) = '##TagName##';
declare @tag_id int = (select id from tags where tagname = @tag_name);

select top (@limit)
  rank() over (order by sum(answers.score) desc) "Rank", "User Link", users.emailHash, users.accountID
  ,sum(answers.score) as "Score"
from users
join posts answers on ( = answers.owneruserid)
join posts parent on (answers.parentid =
join posttags on ( = posttags.postid)
where posttags.tagid = @tag_id
and answers.posttypeid = 2  -- answers only
and answers.CreationDate >= '2019-10-07'
group by, users.emailhash, users.accountID
order by sum(answers.score) desc

Enter Parameters

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