Dupe Hammer usage per User

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy Meta

Q&A about the site for science fiction and fantasy enthusiasts

--DECLARE @UserId varchar(60) = '##UserId##'

select hc.UserId [User Link], count(*) HammerClosed, 
  count(hr.Id) Reopened,
  Round(count(hr.Id)*100.0/count(*),0) PctError
from PostHistory hc
left join PostHistory hr on hr.PostId=hc.PostId 
          and hr.CreationDate > hc.CreationDate
          and hr.PostHistoryTypeId=11
          and hr.text not like '%"Id":' + CAST(hc.UserId AS VARCHAR) + '%'
where hc.PostHistoryTypeId=10
--and hc.UserId = @UserId
and hc.Comment like '101%'
and hc.Text like '%BindingReason":{"GoldTagBadge%'
and hc.CreationDate > getdate()-2
group by hc.UserId
order by count(*) desc;

Enter Parameters

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