📜  如何对 PostgreSQL 代码示例中的所有列进行分组和连接数组

📅  最后修改于: 2022-03-11 15:05:02.855000             🧑  作者: Mango

代码示例1
SELECT DATE_TRUNC('day', date_time), JSON_AGG(t) AS row, SUM(amount) AS total
FROM table_a t GROUP BY DATE_TRUNC('day', date_time);