database stuff

This commit is contained in:
Wolfgang Hottgenroth 2023-11-08 12:51:33 +01:00
parent b64fd0206c
commit 696c299ac9
Signed by: wn
GPG Key ID: 836E9E1192A6B132
2 changed files with 10 additions and 0 deletions

View File

@ -8,3 +8,13 @@ select time_bucket('1 day', time) as interval,
-- daily stats of current month
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;

View File