0
Good morning. I need to calculate between values that are stored in my BD, these values are marked with the + sign and - in their respective tables. I wonder if there is any way to make through a single SQL command I make these account: Sum all values that have the +signal; Sum all values that have the -signal; Decrease the result of each other;
The SQL command I’ve made so far is:
select sum(valeve) as valor from R046VER
where numemp = 404 and numcad = 4170 and codcal = 1136 and
codeve in (select codeve from R008INC where incfgm in('+', '-') and codtab = 1) and
tabeve = 1 and codeve not in(select codeve from R008EVC where codtab = 1
and crteve in('31B','31C','31E','31F','31G','31H','31I','31J','31M','39Z','39Z','39Z','49Z','50A','50F'))