Community wiki answers with multiple editors

1

Please login or register to vote for this query.

(click on this box to dismiss)

http://meta.stackexchange.com/questions/257018/searching-for-community-wiki-answers-with-multiple-editors

English

Q&A for linguists, etymologists, and serious English language enthusiasts

select p.id  as [Post Link]
     , case 
       when posttypeid = 1 then 'Q'
       when posttypeid = 2 then 'A'
       when posttypeid in (4,5) then 'tag'
       else cast(posttypeid as nvarchar)
       end
     , ph.userid as [User Link]
     , p.score
     , ph.creationdate
from posts p
inner join posthistory ph on ph.postid = p.id
inner join users u on ph.userid = u.id
where communityowneddate is not null  -- is CW
and ph.posthistorytypeid in (4,5,6)   -- edits (body, tag, title)
and ph.userid > -1 -- no community please
-- is last edit also from this user
and ph.id = (select max(phm.id) 
             from posthistory phm
             where phm.posthistorytypeid in (4,5,6)
             and phm.postid = ph.postid)
-- are there multiple editors             
and (select count(*) 
     from (
           -- let use first determine the distinct editors
           select distinct phm.userid
           from posthistory phm
           where phm.posthistorytypeid in (4,5,6)
           and phm.postid = ph.postid
       ) editors
    ) > 1 -- more then one editor 
and p.posttypeid = 2
order by ph.creationdate desc

Enter Parameters

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