sql first refactor
This commit is contained in:
14
db/routines/R__fn_planning_future_price_days.sql
Normal file
14
db/routines/R__fn_planning_future_price_days.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
create or replace function ems.fn_planning_future_price_days()
|
||||
returns int
|
||||
language sql
|
||||
stable
|
||||
as $fn$
|
||||
select count(distinct (mip.interval_start at time zone 'Europe/Prague')::date)::int
|
||||
from ems.market_interval_price mip
|
||||
where mip.market_source in ('OTE_CZ', 'OTE_CZ_DAM')
|
||||
and mip.interval_start >= now()
|
||||
and mip.interval_start < now() + interval '48 hours';
|
||||
$fn$;
|
||||
|
||||
comment on function ems.fn_planning_future_price_days() is
|
||||
'Počet kalendářních dní s OTE daty v okně now..now+48h (před spuštěním plánu).';
|
||||
Reference in New Issue
Block a user