Aggregate stats for non-ID-requests

0

Please login or register to vote for this query.

(click on this box to dismiss)

Raspberry Pi

Q&A for users and developers of hardware and software for Raspberry Pi

WITH FilteredPosts AS (
  SELECT *
  FROM Posts
  WHERE PostTypeId = 1 AND Tags <> '<identify-this-%>'
)

SELECT 'Minimum', MIN(Score)
FROM FilteredPosts

UNION

SELECT DISTINCT 'Median', PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY Score) OVER ()
FROM FilteredPosts

UNION

SELECT 'Mean', ROUND(AVG(CAST(Score AS float)), 2)
FROM FilteredPosts

UNION

SELECT 'Maximum', MAX(Score)
FROM FilteredPosts

UNION

SELECT 'StdDev', ROUND(STDEV(Score), 2)
FROM FilteredPosts

Enter Parameters

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