我在 Presto 中有一个数组,我想计算每个元素在其中出现的次数。例如,我有
[a, a, a, b, b]
我想得到类似的东西
{a: 3, b: 2}
sql presto
presto ×1
sql ×1