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:int?-5##
-- ##S2:int?45##
-- ##V2:int?4000##
-- ##dV:int?4##
-- S1 : dhdkhs

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

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

Enter Parameters

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