optimizing the sql query by not repeating the math..
- by user333747
Here is the query in Oracle I was trying to remove the redundant math operation from:
SELECT name,
CASE
when nvl(num1,0) + nvl(num2,0) - nvl(num3,0) > 0
THEN nvl(num1,0) + nvl(num2,0) - nvl(num3,0)
ELSE 0
END
as result,
.... from ....
How do I not repeat the summation above?