The standard SQL form for this uses a correlated subquery:
select t.*,
(select sum(B)
from t t2
where t2.A >= t.A
) as TheSum
from t;
Some databases also support window/analytic functions that allow cumulative sums.
EDIT:
Netezza is one of the databases that support cumulative sums using window functions (thanks to its Postgres heritage, I imagine). You can also express this as:
select t.*,
sum(B) over (order by A desc) as TheSum
from t
EDIT II:
I don't have a Netezza database to test on, but it does have the RowId
column. You might be able to use this, although I cannot find any documentation that guarantees its being monotonically increasing. In fact, I'm pretty sure that for a parallel load, the rowid would not be monotically assigned.
The query would look like:
select t.*,
sum(B) over (order by rowid desc) as TheSum
from t