And there is one more wayCREATE TABLE #Temp(Item_No int,Amount decimal(15,2))INSERT INTO #Temp VALUES(1,100.00),(2,300.00),(3,500.00)SELECT Item_No ,Amount ,CASE WHEN y.Rn =1 THEN Amount ELSE Amount +(SELECT SUM(Amount) FROM (SELECT *,ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS Rn FROM #Temp)x WHERE x.Rn<y.Rn) END AS TotalFROM(SELECT *,ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS Rn FROM #Temp)yDROP TABLE #Temp
---------------Murali KrishnaYou live only once ..If you do it right once is enough.......