Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;with cte([Name],YTD,startnum) AS (select [Name],YTD,1 startnum
- from DB.dbo.TableX
- union all
- select [Name],
- YTD,
- (startnum+1) as startnum
- from cte
- where (startnum+1)<=YTD)
- select [Name], YTD from cte
Add Comment
Please, Sign In to add comment