some more queries

This commit is contained in:
Wolfgang Hottgenroth 2023-02-08 21:08:32 +01:00
parent df45cb5daa
commit 79ee9898e7
Signed by: wn
GPG Key ID: 836E9E1192A6B132
2 changed files with 7 additions and 0 deletions

7
schema/queries02.sql Normal file
View File

@ -0,0 +1,7 @@
select time_bucket('1 day', time) as interval,
round((last(exportenergyactive, time) - first(exportenergyactive, time))::numeric, 2) as energy
from pv_power_measurement_t
where time between date_trunc('month', now()) and date_trunc('month', now()) + interval '1 month'
group by interval
order by interval;