2014-05-06 00:48:48 +08:00
|
|
|
WITH data AS (
|
2017-12-06 05:16:39 +08:00
|
|
|
SELECT array_agg(x::numeric) AS s
|
|
|
|
FROM generate_series(0, 99) AS x
|
2014-05-06 00:48:48 +08:00
|
|
|
)
|
2017-12-06 05:16:39 +08:00
|
|
|
SELECT unnest(CDB_QuantileBins(s, 10))
|
|
|
|
FROM data;
|
2016-04-29 00:50:09 +08:00
|
|
|
|
|
|
|
WITH data_nulls AS (
|
2017-12-06 05:24:11 +08:00
|
|
|
SELECT array_agg(x::numeric) AS s
|
2017-12-06 05:16:39 +08:00
|
|
|
FROM (
|
|
|
|
SELECT x FROM generate_series(0, 99) AS x
|
|
|
|
UNION ALL
|
2017-12-06 05:24:11 +08:00
|
|
|
SELECT null AS x FROM generate_series(1, 10) AS x
|
2017-12-06 05:16:39 +08:00
|
|
|
) _wrap
|
2016-04-29 00:50:09 +08:00
|
|
|
)
|
2017-12-06 05:16:39 +08:00
|
|
|
SELECT unnest(CDB_QuantileBins(s, 10))
|
|
|
|
FROM data_nulls;
|