/* top 50 users by rep network-wide and their top post in...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Gardening and Landscaping

Q&A for gardeners and landscapers

/* 
  top 50 users by rep network-wide
  and their top post including bounties
*/

SELECT TOP (50) 
       account_id, 
       total_reputation = SUM(reputation),
       total_sites = count(*),
       total_questions = sum(question_count),
       total_answers = sum(answer_count),
       site_list = STRING_AGG(u.site_id, ',')
FROM sede_users u
--inner join sede_sites s on s.site_id = u.site_id
group by account_id
order by total_reputation desc

Enter Parameters

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