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