Negative vs. Positive Questions over time

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Engineering

Q&A for expert programmers interested in professional discussions on software development

Select createYear
  , SumPosViews / NumQs as AvgViewPerPositive
  , SumNeutralViews / NumQs as AvgViewPerNeutral
  , SumNegViews / NumQs as AvgViewPerNegative

FROM
(

  Select
    sum(case when score > 0 then ViewCount * 1.0000 else 0 end) as SumPosViews,
    sum(case when score = 0 then ViewCount * 1.0000 else 0 end) as SumNeutralViews,
    sum(case when score >= 0 then 0 else ViewCount * 1.0000 end) as SumNegViews,
    year(CreationDate) as CreateYear,
    Count(*) as NumQs
  from Posts where posttypeid = 1 and year(CreationDate) >= 2015
  group by
    year(CreationDate)
) as T
order by CreateYear

Enter Parameters

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