Redwolf, Caird, Diamond closing trio

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drones and Model Aircraft Meta

Q&A for experienced flyers, pilots, and builders of drones and model aircraft

select postid as [Post Link],
       Diamond as [User Link],
       votes as [Num voters]
from
(
    select postid 
         --- userid here
         , sum(case when voterid = 66833 then  66833 else null end) Caird
         , sum(case when voterid = 79857 then  79857 else null end) Redwolf
         , sum(case
           when voterid = 68942 then 68942
           when voterid =  3808 then  3808
           when voterid = 76162 then 76162
           when voterid = 56656 then 56656
           else null end) Diamond
           , Count(voterid) votes
    from posthistory ph
    cross apply openjson(text, '$.Voters') 
       with (
         VoterId Int '$.Id', 
         DisplayName nvarchar(200) '$.DisplayName') voters 
    where ph.posthistorytypeid = 10
    -- userid here  -- V
    and voterid in (66833, 79857, 68942, 3808, 76162, 56656)
    and text is not null
    group by postid
) data
where Caird is not null 
  and Redwolf is not null
  and Diamond is not null

Enter Parameters

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