Presto SQL - How can i get all possible combination of an array? Presto SQL - How can i get all possible combination of an array? database database

Presto SQL - How can i get all possible combination of an array?


There is combinations(array(T), n) function and it does exactly what you want:

select combinations(array[1,2,3,4],2);