Hi, I need help.I have a 4 fields table like this:DECLARE @TABLE TABLE( date datetime, account int, Debit int, Credit int)INSERT INTO @TABLESELECT getdate(),100511, 100, 0 UNION ALLSELECT getdate(),100511, 100, 0 UNION ALLSELECT getdate(),100511, 0, 50 UNION ALLSELECT getdate(),100511, 100, 0SELECT * FROM @TABLE
What i Want is to make a field Balance, for each row.I have read about cross and outer apply, but examples i fond in this forum, only works with transactions that hast unique key for each transaction.How can i use here Apply?Thanks