If we go to the top users list for a particular tag (say sql), the ranking is ordered by the total score of users on that tag. How can we show the list ordered by number of posts?
-
2I believe you'll need to use SEDE for that. The site UI doesn't provide any way to change the sort order. Perhaps start here: How can I retrieve list of top 100 users on Stack Exchange for a specific tag sorted by posted content? If you're lucky, rene will come by and write a queue to specifically answer your question.– Cody Gray ModCommented Dec 27, 2020 at 9:24
1 Answer
As predicted by Cody, you're lucky.
Here is the SEDE Query.
Notice that you need to provide a tagname and whether you want answers or questions as the ranking. That is similar to what is shown on the top users page.
-- qa:1 for questions, 2 for answers
select rank() over(order by count(*) desc) rank
, owneruserid [User Link]
, count(*) [Number of posts]
from posts p
inner join posttags pt on pt.postid = coalesce(p.parentid, p.id)
inner join tags t on t.id = pt.tagid
where owneruserid is not null
and communityowneddate is null
and p.posttypeid = ##qa:int?2##
and t.tagname = ##tagname:string?sql##
group by owneruserid
order by count(*) desc
When run today (with the restore for this week still going) this is the result:
Careful observers will notice that the count reported here is off compared to that is in top 30 list on the tag page. I suspect this is due to synonyms and/or other data errors, not because the query is screwed.
Keep in mind SEDE is updated once a week on Sunday.
Use the awesome SEDE Tutorial written by the unforgettable Monica Cellio.
Say "Hi" in SEDE chat.
-
-
2
-
8