I have Oracle SQL query. In results I get something like that:
CODE || VALUE
I || 10
II || 30
III || 50
IV || -20
V || 60
VII || -45
VIII || 0
IX || 100
X || 0
Next I want for CODE = X create formule like:
CASE 1:
SUM OF I,II,III,IV,V,IX
CASE 2:
I+II+III-IV-V+IX
How can I implent these formule in sql query?