如何选择TOP 50%的MIN值?

时间:2015-10-07 20:05:04

标签: sql ms-access

我发现一组薪水的第50个百分点。如何选择一组数据中前50%的MIN值?这是我失败的语法:

SELECT MIN(SELECT TOP 50 PERCENT [PrimaryCompensationBasis-Amount(USD)])
FROM qryEEGroup;

谢谢!

1 个答案:

答案 0 :(得分:2)

尝试使用嵌套的select语句:

SELECT MIN([PrimaryCompensationBasis-Amount(USD))
FROM (SELECT TOP 50 PERCENT [PrimaryCompensationBasis-Amount(USD)] FROM qryEEGroup ORDER BY [PrimaryCompensationBasis-Amount(USD)]) tab;