query with wrong calculation
Hello,
We have a problem in the result of table field values, I want to understand if there is a bug or some incompatibility.
this is not a performance issue.
--Original Table field values
select cred_deb,sum(VALOR) valor from luizpereira.debug_resumo group by cred_deb;
CRED_DEB valor
D 1467607,75
C 44228259,28
--Query original - not work
select sum(case when CRED_DEB = 'D' then VALOR*-1 else 0 end) valor from luizpereira.debug_resumo;
result:
Valor
0
--Query teste (without multiply by -1) -- works
select sum(case when CRED_DEB = 'D' then VALOR else 0 end) valor from luizpereira.debug_resumo;