Aggregate stats for non-ID-requests

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

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 sites:
loading Hold tight while we fetch your results