Voting makeup in regards to IDs

0

Please login or register to vote for this query.

(click on this box to dismiss)

Movies and TV

Q&A for movie and tv enthusiasts

select 
    dateadd(month, datediff(month, 0, p.CreationDate), 0) mo,
    count(distinct p.id) as QuestionCount,
    count(distinct case when p.tags like '%identify%' then p.id else null end) as QuestionCountID,
    count(v.id) as VoteCount,
    sum(case when p.tags like '%identify%' and v.id is not null then 1 else 0 end) as VoteCountID
from postswithdeleted p
  left outer join votes v
    on v.postid = p.id
        and v.votetypeid in
        (
            4, 6, 7, 10, 11, 12, 15, 16
        )
where p.posttypeid = 1
group by dateadd(month, datediff(month, 0, p.CreationDate), 0)
order by dateadd(month, datediff(month, 0, p.CreationDate), 0)

Enter Parameters

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