|
2
|
| Navaneeth K N · 技术社区 · 16 年前 |
|
1
6
The "query optimiser" is what's happening. When you run a query, SQL Server uses a cost-based optimiser to identify what is likely to be the best way to fulfil that request (i.e. it's execution plan). Think about it as a route map from Place A to Place B. There may be many different ways to get from A to B, some will be quicker than others. SQL Server will workout different routes to achieve the end goal of returning the data that satisfies the query and go with one that has an acceptable cost. Note, it doesn't necessarily analyse EVERY possible way, as that would be unnecessarily expensive. In your case, the optimiser has worked out that those 2 queries can be collapsed down to the same thing, hence you get the same plan. |
|
|
Johnny T · 基于当前值的SQL合并表[重复] 1 年前 |
|
John D · 需要为NULL或NOT NULL的WHERE子句 1 年前 |
|
ojek · 如何对SQL结果进行分组和编号? 1 年前 |
|
|
senek · 如何在PL/SQL中将选择结果(列)放入数组中 1 年前 |
|
|
Sax · 规范化Google表格(第一步) 1 年前 |
|
|
Jatin · 检索卷计数的动态sql抛出错误语法错误[关闭] 1 年前 |
|
|
Andrus · 如何在sql中查找第二个匹配项 1 年前 |