DBA> select * from teste123; COD VALOR ---------- ---------- 1 1 2 2 3 3 4 4 5 5 6 6 7 7
7 rows selected. DBA> select sum(VALOR) from teste123; SUM(VALOR) ---------- 28 1 row selected. DBA> select sum(case when cod=7 then (valor*(-1)) else valor end) valor2 from teste123; VALOR2 ---------- 14 Ederson Elias DBA Oracle http://br.linkedin.com/pub/ederson-elias/24/8b/8b0 ------------ Labor improbus omnia vincit