Using the example I need to calculate a value in r1 pass the value to r2, recalculate from the passed value maintaining the passed value and then pass the new value to r3. Noting that the aggregation is by column a and b. Normally I would use a cursor for this but it is not an option and having some trouble figuring it out , any help would be greatly appreciated.
↧
How to replace a SQL Server Cursor with recursive CTE ?
↧