[thelist] SQL Server 2008 - How to get the 95% percentile?

r937 rudy at r937.com
Tue Jun 14 15:47:45 CDT 2011


> This way you don't lop off any at the "high" end that 
> are equal to the highest result allowed at 95%.
>
> Rudy will set me straight, if I'm way off base. :-)

i'm not sure i even understand what percentile means

but consider what would happen if you said

   SELECT AVG(score) 
     FROM ( SELECT TOP 95 PERCENT WITH TIES score 
              FROM dbo.TestScores
            ORDER 
                BY score DESC
          ) AS Top95PercentAvg
   
notice the ORDER BY is DESC

that way, "with ties" will lop off any extra piddly ones at the bottom

is that still a 95th percentile?

--
rudy
http://r937.com/



More information about the thelist mailing list