Guest User

Untitled

a guest
Jan 23rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. ;with cte([Name],YTD,startnum) AS (select [Name],YTD,1 startnum
  2. from DB.dbo.TableX
  3. union all
  4. select [Name],
  5. YTD,
  6. (startnum+1) as startnum
  7. from cte
  8. where (startnum+1)<=YTD)
  9. select [Name], YTD from cte
Add Comment
Please, Sign In to add comment