0
我想在下面的查询中聚集的数组(不工作)插入聚合成阵列
select
c.app_id,
90 as interval,
'day_of_week' as group,
array_agg(
count(extract(dow from c.inserted_at) = 0 or null),
count(extract(dow from c.inserted_at) = 1 or null),
count(extract(dow from c.inserted_at) = 2 or null),
count(extract(dow from c.inserted_at) = 3 or null),
count(extract(dow from c.inserted_at) = 4 or null),
count(extract(dow from c.inserted_at) = 5 or null),
count(extract(dow from c.inserted_at) = 6 or null)
) as series
from conversations c
left join apps a on c.app_id = a.id
where c.inserted_at::date > (current_date - (90 || ' days')::interval)::date
group by app_id
它抛出一个语法错误
'ARRAY [计数(...),...]作为series'? – Ryan