华为云首页
用户手册
数智融合计算服务 DATAARTSFABRIC-数字操作函数:width_bucket(operand numeric, b1 numeric, b2 numeric, count int)
数智融合计算服务 DATAARTSFABRIC-数字操作函数:width_bucket(operand numeric, b1 numeric, b2 numeric, count int)
时间:2025-06-17 08:50:02
width_bucket(operand numeric, b1 numeric, b2 numeric, count int)
描述:设定分组范围的最小值、最大值和分组个数,构建指定个数的大小相同的分组,返回指定字段值落入的分组编号。b1为分组范围的最小值,b2为分组范围的最大值,count为分组的个数。
返回值类型:integer
示例:
1 2 3 4 5 |
SELECT width_bucket(5.35, 0.024, 10.06, 5); width_bucket -------------- 3 (1 row) |
support.huaweicloud.com/devg-fabric/dataartsfabric_sql_04_0206.html