计算第 95 个百分位的值? [英] Calculating the 95th Percentile value?

查看:30
本文介绍了计算第 95 个百分位的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试计算表格列中的第 95 个百分位点,并且正在使用 TOP 95 PERCENT 构造.我想知道以下方法是否正确,或者是否有更好的方法来做同样的事情.

I am trying to calculate the 95th percentile point in my table column and am using the TOP 95 PERCENT construct. I was wondering if the following approach is correct or if there is a better way of doing the same.

SELECT AVG(Value) 
FROM
(
    SELECT TOP 95 PERCENT WITH TIES Value
    FROM [Sample].[dbo].[numbers]
    ORDER BY Value DESC
) AS NineP

推荐答案

这将使您获得(大约)97.5 个百分点,因为您取的是前 5% 的平均值.你想SELECT MIN(Value)

That would get you the (roughly) 97.5 percentile point, because you're taking the average of the top 5%. You want to SELECT MIN(Value)

这篇关于计算第 95 个百分位的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆