Question View Count Distribution

0

Please login or register to vote for this query.

(click on this box to dismiss)

Arqade

Q&A for passionate videogamers on all platforms

CREATE TABLE #View_Posts 
(
  id int IDENTITY PRIMARY KEY NOT NULL, 
  ViewCount int NOT NULL
)

INSERT INTO #View_Posts (ViewCount)
SELECT ViewCount FROM Posts 
WHERE PostTypeId = 1
ORDER BY ViewCount

SELECT * FROM #View_Posts 
WHERE (id % CEILING((SELECT COUNT(*) FROM #View_Posts)/100) = 0)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached