View percentiles for bountied questions


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers


BountiedPosts AS (
    SELECT p.*
    FROM   Posts p
           JOIN Votes v ON v.PostId = p.Id AND v.VoteTypeId = 8
    WHERE  p.Score >= 0
           AND ClosedDate IS NULL

Percentiles AS (
    SELECT NTILE(100) OVER(ORDER BY ViewCount) AS Percentile, 
    FROM   BountiedPosts

SELECT MIN(ViewCount) NumberOfViews, Percentile
FROM   Percentiles
GROUP BY Percentile
ORDER BY Percentile

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results