web: fixed cursed-query
This commit is contained in:
parent
670313a54c
commit
4d360bb5e4
1 changed files with 4 additions and 4 deletions
|
@ -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 (
|
||||
|
|
Loading…
Reference in a new issue