百分位数(0.25)=百分位数(0.5)=百分位数(0.75)我错了吗?

时间:2019-02-08 03:04:43

标签: mysql sql

我需要确定每个import_count_index中的值的百分位数

FORMAT(PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY `VALUE_`) OVER (PARTITION BY`IMPORT_COUNT_INDEX`) ,1)AS MEDIAN 

FORMAT(PERCENTILE_DISC(0.25) WITHIN GROUP (ORDER BY `VALUE_`) OVER (PARTITION BY `IMPORT_COUNT_INDEX`) ,1)AS PCT25

FORMAT(PERCENTILE_DISC(0.75) WITHIN GROUP (ORDER BY `VALUE_`) OVER (PARTITION BY `IMPORT_COUNT_INDEX`) ,1)AS PCT75 

FROM `rs_pre_calibration` WHERE (`RESULT_ID` = 2008) AND `JOB_NO`= 'EXF0974' AND `MC_NO` = 'BP44' AND (`TEST_DATE` BETWEEN '2013-01-01' AND '2019-02-08')

GROUP BY `JOB_NO`,`MC_NO`,`TEST_DATE`,`TEST_TIME` ORDER BY`AUTOINDEX`

数据 enter image description here

0 个答案:

没有答案