From 4d360bb5e46e6ca69792d902d483984c9d11cbd8 Mon Sep 17 00:00:00 2001 From: radex Date: Tue, 9 Jul 2024 00:01:41 +0200 Subject: [PATCH] web: fixed cursed-query --- web/webapp/cursed-query.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/webapp/cursed-query.sql b/web/webapp/cursed-query.sql index 968ec9b..f1af08b 100644 --- a/web/webapp/cursed-query.sql +++ b/web/webapp/cursed-query.sql @@ -14,14 +14,14 @@ with transfer2 as ( and title not like 'Lokata nr DP%' ), transfer3 as ( - select dt, case currency when 'PLN' then amount_rel when 'EUR' then amount_rel * :EURPLN_RATE else NULL end as amount_c, to_name from transfer2 + select dt, case currency when 'PLN' then amount_rel when 'EUR' then amount_rel * :EURPLN_RATE else NULL end as amount_c, to_name from transfer2 ), monthly_incomes as ( select dt, sum(amount_c)/100.0 as month_balance_i from transfer3 - where to_name not like '%PSP Zjednoczenie%' and amount_c > 0 + where to_name !~* 'zj ?ednoczenie' and amount_c > 0 group by dt order by dt ), monthly_rest as ( @@ -29,7 +29,7 @@ monthly_rest as ( dt, sum(amount_c)/100.0 as month_balance_r from transfer3 - where to_name not like '%PSP Zjednoczenie%' and amount_c < 0 + where to_name !~* 'zj ?ednoczenie' and amount_c < 0 group by dt order by dt ), monthly_psp as ( @@ -37,7 +37,7 @@ monthly_psp as ( dt, sum(amount_c)/100.0 as month_balance_p from transfer3 - where to_name like '%PSP Zjednoczenie%' + where to_name ~* 'zj ?ednoczenie' group by dt order by dt ), joined as (