select account_id , sum(reputation) [totalrep] , count(*)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Earth Science

Q&A for those interested in the geology, meteorology, oceanography, and environmental sciences

select account_id
     , sum(reputation) [totalrep]
     , count(*) [sites]
     , sum(question_count) [questions]
     , sum(answer_count) [answers]
     , min(s.database_name) [db]
into #accounts
from sede_users u
inner join sede_sites s on s.site_id = u.site_id
group by account_id
having sum(reputation) > 9000

create table #names(accountid int, name varchar(40))

exec sede_ineachdb @sqlcommand = '
  insert into #names
  select accountid, displayname from users du
  inner join #accounts a on du.accountid = a.account_id
  where a.db = db_name()
  ',
  @includemainsites = 1,
  @includemetasites = 0,
  @includemainmeta = 1,
  @CollectResultsForMe = 0


select concat('https://stackexchange.com/users/',a.account_id, '|', n.name) [User]
     , a.[totalrep]
     , a.[questions]
     , a.[answers]
     , a.[sites]
from #accounts a
inner join #names n on n.accountid = a.account_id
order by [totalrep] desc

Enter Parameters

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