question

spindr0527 avatar image
spindr0527 asked

How to replace a SQL Server Cursor with recursive CTE ?

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.

ctecursors
sql-problem.png (210.9 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.