Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Get running total in the following query

    DECLARE @CumCredit TABLE

    (RowId INT, CustomerId INT, TransId INT, Pts INT)

    INSERT INTO @CumCredit (Rowid, CustomerID, TransId, pts)

    select 1,123,121,10

    union

    select 2,123,131,20

    union

    select 3,123,141,15

    select * from @CumCredit

    select a.*, (select sum(Pts) from @CumCredit where rowid<=a.rowid)...

Viewing post 1 (of 1 total)