get all the users who writes (AND EDITS) the tags information related to a set of questions


Please login or register to vote for this query.

(click on this box to dismiss)

Literature Meta

Q&A about the site for scholars and enthusiasts of literature

declare @postId1 as int,@postId2 as int,@postId3 as int,@postId4 as int,@postId5 as int
declare @postId6 as int,@postId7 as int,@postId8 as int,@postId9 as int,@postId10 as int
set @postId1 = 2512683;
set @postId2 = 2512691;
set @postId3 = 2512696;
set @postId4 = 2512698;
set @postId5 = 2512702;
set @postId6 = 2512713;
set @postId7 = 2512717;
set @postId8 = 2512718;
set @postId9 = 2512720;
set @postId10 = 2512723;

-- need to do this nested joins because of the stupid duplicates IDS possible
select * from Users mp1 inner join (
select distinct u.Id from Users u inner join 
select * from Posts x inner join 
select ExcerptPostId from Tags t inner join 
select distinct  TagId from PostTags
where PostId = @postId1 or PostId = @postId2 or PostId = @postId3 or PostId = @postId4 or PostId = @postId5
or PostId = @postId6 or PostId = @postId7 or PostId = @postId8 or PostId = @postId9 or PostId = @postId10) s
on = s.TagId
) y on x.Id = y.ExcerptPostId ) temp1

on u.Id = temp1.OwnerUserId or u.Id = temp1.lastEditorUserId
) mp2 on mp1.Id = mp2.Id

Enter Parameters

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