Ян Петрушкин
Мастер
(2187),
на голосовании
5 лет назад
Текущий запрос:
SELECT date_trunc('minute', timestamp), array_agg(value::float ORDER BY value DESC) from sensor.airsensor WHERE parameter='pm025' AND timestamp > (now() - interval '1 minute') GROUP BY timestamp;
SELECT date_trunc('minute', timestamp), array_agg(value::float ORDER BY value DESC)
from sensor.airsensor
WHERE parameter='pm025' AND
timestamp > (now() - interval '1 minute')
GROUP BY timestamp;
Ответ:
"2019-09-17 14:19:00""{12.28}"
"2019-09-17 14:19:00""{11.49}"
"2019-09-17 14:19:00""{10.92}"
"2019-09-17 14:19:00""{12.36}"
"2019-09-17 14:19:00""{12.14}"
"2019-09-17 14:19:00""{11.03}" ...
Нужно: 1 колонка - timestamp
Вторая колонка - массив