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 [счет (...), ...] как серия'? – Ryan