Alt dette kræver er en simpel betinget logik:
SELECT t.id, t.count,
@running_total := if(transactionType = 'RESET', t.value,
@running_total + t.value
) as CurrentBalance
FROM TABLE t JOIN
(SELECT @running_total := 0) params
ORDER BY t.id;