对于 PostgreSQL,你可以参考以下 SQL 查询获取本周的数据: SELECT extract(epoch from clock) as timestamp, itemid, value FROM history WHERE clock >= date_trunc('week', current_date) AND clock < date_trunc('week', current_date) + interval '1 week' ORDER BY itemid, clock;...
回答于 2024-03-07 09:37