Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Continuation of Message #1594531 - Use of WHERE
Message
From
23/02/2014 11:12:37
 
 
To
23/02/2014 03:02:36
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01594922
Message ID:
01594992
Views:
42
I stand corrected on the multiple CTE,s in one statement. I should have said that with that one CTE's cannot be used in more than one statement.

Right, you can't use the same CTE across multiple subsequent SELECT statements.

So in summary, this is permitted
;WITH CTE1 as  (select whatever),   CTE2 as (select whatever)
SELECT * from SomeTable  JOIN CTE1.... JOIN CTE2
But this is NOT permitted
;with cte1 as   (select whatever)

select * from sometable join CTE1
select * from somedifferenttable join CTE1
On the other issue with the link to the Microsoft Connect item, I understand what you mean, though no idea if it would ever be implemented. In reading the posts, I'm a little confused whether that became part of the SQL specification beyond the '99 standard (specifically, if it was expanded in SQL:2003)
Previous
Reply
Map
View

Click here to load this message in the networking platform