2D Histogram of question views vs. score

0

Please login or register to vote for this query.

(click on this box to dismiss)

History

Q&A for historians and history buffs

-- S1 : Lower limit on Score

DECLARE @NV int = ##V2## / ##dV## -- bins in viewcounts

SELECT sel.Idx, Count(*) as [Occurence]
FROM
(SELECT (Score - ##S1##) * @NV + ViewCount / ##dV:int?4## as [Idx]
FROM Posts
WHERE PostTypeId = 1 -- questions
      and Score >= ##S1:int?-5## and Score < ##S2:int?45##
      and ViewCount < ##V2:int?4000##) sel
GROUP BY sel.Idx
ORDER BY sel.Idx

Enter Parameters

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