How can i do cumulative sum?
My query is :
select dateb,ricetype,bajet1
from bajet
where ricetype='grand total'
How do i archieve 'New Value'?
How can i do cumulative sum?
My query is :
select dateb,ricetype,bajet1
from bajet
where ricetype='grand total'
How do i archieve 'New Value'?
You can do it like below :
set @CumSum := 0;
select dateb, ricetype, bajet1, (@CumSum := @CumSum + bajet1) as New_Value
from bajet where ricetype='grand total';