【发布时间】:2023-09-16 06:37:01
【问题描述】:
我想要给定数组中一个数字的所有可能组合。
我尝试使用一些 presto 的预定义函数,例如 array_agg(x)
Input : [1,2,3,4]
Output
when n=2 : [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
when n=3 : [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
when n=4 : [[1,2,3,4]] or [1,2,3,4]
【问题讨论】:
-
这超出了 SQL 的能力。
标签: arrays database hive presto