April 27, 2011 at 3:03 am
Can someone explain how the below result arrives please ?
with CTE(x)as
(
select x = 1
union all
select X=X+1 from CTE where x < 4
union all
select X=X+1 from CTE where x < 4
)
select x from CTE
GO
Result:
x
1
2
2
3
3
4
4
4
4
3
3
4
4
4
4
April 27, 2011 at 4:49 am
Please don't cross post. It just wastes peoples time and fragments replies.
No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic1099236-391-1.aspx
Thanks
Parthi
April 27, 2011 at 5:01 am
Edit: Moved here.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 27, 2011 at 5:35 am
Yes Chris, appologies.
I thought i had posted in the wrong category so posted under T-SQL too.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply