如何使用 Amazon Athena 中的架构和表计算四分位数?

问题描述 投票:0回答:0

我想计算 Amazon Athena 中的第一个四分位数、中位数、第三个四分位数和第 99 个百分位数,其中数据库和表是从 Glue Data Catalog 创建的。

我输入的示例查询是:

select
  percentile_cont(0.25) within group (order by duration column_name) as percentile_25,
  percentile_cont(0.50) within group (order by duration column_name) as percentile_50,
  percentile_cont(0.75) within group (order by duration column_name) as percentile_75,
  percentile_cont(0.95) within group (order by duration column_name) as percentile_95
from "schema"."table_name";

还有什么其他方法可以计算四分位数?

sql amazon-athena presto trino
© www.soinside.com 2019 - 2024. All rights reserved.