How do we know 6000 comes before 4200 ?

also, your description and the results don't seem to match.

It looks like your B is an add and A is subtract.

last thing.

Do B records always use the beginning_dr value and A records always use the beginning_cr value for the math, or should we sum the two columns and use the results or use some other operation?

Assuming...

there is a sortable column like an ID

and you always ADD beginning_dr for B

and always SUBTRACT beginning_cr for A

then try this..

SELECT beginning_dr,

beginning_cr,

status,

SUM(CASE WHEN status = 'B' THEN beginning_dr ELSE -beginning_cr END) OVER (ORDER BY id)

FROM yourtable

ORDER BY id;

if any of those assumptions are not correct, then please elaborate. Note a running total is ONLY possible if you have a sortable criteria of some kind.