6

I searched before, but I didn't find any solution. I am just curious to know who asked the most questions on Stack Overflow or another Stack Exchange site. How can I find this information?

2 Answers 2

10

You can use the Stack Exchange Data Explorer (SEDE) to query sites for information like this. It does require knowledge of SQL to write queries (there is a tutorial under the SEDE help pages if you're interested), but there are a lot of existing queries you can use and you can search SEDE as you can any other Stack Exchange site.

An existing query that should give you what you're looking for:

7

You got the per-site query from Cai, let me add the network-wide query.

-- result table, don't rename and keep the site column
create table #results ( site nvarchar(250)
                       , displayname nvarchar(40)
                       , qcount int
                       , accountid int);

declare @sql nvarchar(max) = ''   -- holds build up sql string

-- build one biq union sql, for each db
select @sql = @sql 
+ iif( len(@sql) > 1 
     , 'union'
     , 'insert into #results'
) +
-- here goes the per site query, fully qualify the database objects
N'
select ''' + name + '''
     , u.displayname
     , count(*)
     , u.accountid
from ' + quotename(name) + '.dbo.posts p
inner join ' + quotename(name) + '.dbo.users u on u.id = p.owneruserid
where posttypeid = 1 -- Q
group by u.displayname
    , u.accountid
'
from sys.databases
where database_id > 5
-- and (name not like '%.Meta' or name = 'StackExchange.Meta')

--print @sql

-- execute it
exec (@sql)

-- show results
select
      'https://stackexchange.com/users/' 
      + cast(accountid as nvarchar) 
      +'?tab=top|' + max(displayname) as [network user]
      -- rest of columns
      , sum(qcount) as [# questions network wide]
from #results
group by accountid
order by sum(qcount) desc 

drop table #results

When run today the result looks like this:

most questions asked network wide

And that makes Tim the winner.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .