I know this can be done but unfortunately, I cannot remember how to code it.
If i have the following select statement
select a, b, c, (case when a = 2 then a else b + c) as newfield
from testtbl
where a <9
this will result in quite a few records. What I want to do is a sum statement to get the sum of newfield.
can someone assist?
thx
If i have the following select statement
select a, b, c, (case when a = 2 then a else b + c) as newfield
from testtbl
where a <9
this will result in quite a few records. What I want to do is a sum statement to get the sum of newfield.
can someone assist?
thx