Tag wiki suggestions by user

1

Please login or register to vote for this query.

(click on this box to dismiss)

Find all suggested edits on tag excerpts and/or wikis of a specific user. I created this to track user 228959's tag wiki edit suggestions. PTId: Post Type Id 4: Excerpt 5: Wiki

Stack Overflow

Q&A for programmers

declare @userid as int = ##UserId:int##

set nocount on 

declare @SuggestedVoteStats table (SuggestedEditId int, up int, down int) 

insert @SuggestedVoteStats
select
    SuggestedEditId, 
    up = sum(case when VoteTypeId = 2 then 1 else 0 end), 
    down = sum(case when VoteTypeId = 3 then 1 else 0 end)
from SuggestedEditVotes
where TargetUserId = @userid
group by SuggestedEditId

set nocount off

select
s.Id as [Suggested Edit Link],
t.TagName,
p.PostTypeId as [PTId],
svs.up,
svs.down,
s.CreationDate,
(case when s.ApprovalDate is not null then s.ApprovalDate else s.RejectionDate end) as [A/R Date],
s.Comment
from SuggestedEdits s
inner join Posts p on s.PostId=p.Id
inner join @SuggestedVoteStats svs on s.Id = svs.SuggestedEditId
inner join Tags t on (t.ExcerptPostId = p.Id OR t.WikiPostId = p.Id)
where (p.PostTypeId=4 OR p.PostTypeId=5)
and s.OwnerUserId = @userid
order by s.CreationDate desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results