Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Support for ordering on AS
Message
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01391988
Message ID:
01392548
Views:
67
Hi David,

As you know, SQL is declarative language and as such describes only what result you want not how to get it. It's up to query processor (QP) to build appropriate execution plan. The SQL server QP is smart enough in simple cases to merge those two selects into one. As I mention in my previous post, most likely it'll result in the same query execution plan as the one w/o derived table.

>
>select * from ( select ... ) doesn't result in doubled work?
>
>>There's no second query in this case. As I mentioned in my other post, the execution plan for such query in most cases would be the same as with your suggestion.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform