From 6856164bbefba79ad8eb605b576de43710f6970f Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 26 May 2021 15:00:01 +0200 Subject: [PATCH] beautify --- function_total_energy_by_day_and_device.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/function_total_energy_by_day_and_device.sql b/function_total_energy_by_day_and_device.sql index a144f26..8302bcf 100644 --- a/function_total_energy_by_day_and_device.sql +++ b/function_total_energy_by_day_and_device.sql @@ -69,7 +69,9 @@ create or replace function total_energy(p_start_day date, p_end_say date) v_deviceid text; v_result rt_totalizer_result%rowtype; begin - for v_deviceid in select distinct deviceid from power_measurement_t loop + for v_deviceid in select distinct deviceid + from power_measurement_t + loop v_day := p_start_day; loop select energy