0
How to calculate two subquery on Oracle?
Could you explain to me how I sum up VALOR_1
+ VALOR_2
?
SELECT COL1
, (SELECT SUM(TAB1.VLRTOTAL)
FROM TABELA TAB1
WHERE TAB1.ID = TAB3.ID) AS VALOR_1
, (SELECT SUM(TAB2.VLRTOTAL)
FROM TABELA2 TAB2
WHERE TAB2.ID = TAB4.ID) AS VALOR_2
FROM TABELA3 TAB3, TABELA4 TAB4
WHERE TAB4.ID = TAB2.ID
AND TAB2.ID <= 10