Useful for finding all posts by unregistered users. The first line of results gives a total for all accounts matched. The total reputation calculated subtracts the 1 rep you get for each account, except for the first account. This should be what the user's rep would be if all accounts were merged, assuming none of the accounts have a +100 association bonus.
Q&A for science fiction and fantasy enthusiasts
create table #Total ([User Link] INT, Reputation INT, Questions INT, Answers INT, CreationDate DateTime) insert into #Total select u.Id, u.Reputation, count(distinct q.Id), count(distinct a.Id), u.CreationDate from Users u left join Posts q on q.OwnerUserId = u.Id and q.PostTypeId = 1 left join Posts a on a.OwnerUserId = u.Id and a.PostTypeId = 2 where lower(DisplayName) like lower(##name:string?%Golding##) group by u.Id, u.Reputation, u.CreationDate insert into #Total select NULL, sum(Reputation)-count(*)+1, sum(Questions), sum(Answers), NULL from #Total select * from #Total order by coalesce(CreationDate, '2100-01-01') desc