id merchant_enrolled_program_id point current_balance Expected RESULT 7499475 23140 -111634 288636 288636 7499601 23140 -266593 288636 22043 7500024 23140 1500000 288636 1522043 7500059 23140 -74314 288636 1447729 7500191 23140 -14049 288636 1433680
select coalesce(at.current_balance+(select sum(a1.point) from akshaya_temp a1 where a1.id <at.id and a1.merchant_enrolled_program_id=at.merchant_enrolled_program_id order by a1.id limit 1,1),at.current_balance) into v_current_balance from akshaya_temp at where at.id=v_ID and at.merchant_enrolled_program_id= v_merchant_enrolled_program_id;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)