fix month yield
This commit is contained in:
@ -41,7 +41,7 @@ with
|
||||
date_trunc('day', min(time)) as day
|
||||
from pv_power_measurement_t
|
||||
where
|
||||
time between date_trunc('month', time) and now()
|
||||
time between date_trunc('month', now()) and now()
|
||||
),
|
||||
first_value as (
|
||||
select
|
||||
@ -64,6 +64,9 @@ with
|
||||
group by interval
|
||||
)
|
||||
select
|
||||
(select day from first_day_in_month) as v1,
|
||||
(select energy from first_value) as v2,
|
||||
(select energy from last_value) as v3,
|
||||
to_char((select day from first_day_in_month), 'Month') as period_value,
|
||||
'Month' as period_name,
|
||||
(select energy from last_value) - (select energy from first_value) as yield;
|
||||
|
Reference in New Issue
Block a user