第一章:逻辑查询处理 Logical Query Processing

    1.什么是T-SQL?

    T-SQL 是SQL的Microsoft SQL Server 方言----Transcact-SQL,它遵循 ANSI 标准。

    2.逻辑查询处理中的各个阶段

        

8select (9) distinct (11) <TOP_spicification> <select_list>1from <left_table>

     (3)  <jiong_type> join <right_table>

     (2)  on <join_condition>

     (4)  where <where_condition>

     (5)  group by <group_by_list>

     (6)  with {cube | rollup }

     (7)  having <aving_condition>

     (10) order by <order_by_list>

   概述:

1.From :对From中的前两个表执行笛卡尔积(Cartesian product)(交叉联接),生成虚拟表 VT1;

2.On : 对VT1 应用 on 筛选器 。只有使<join_condition>为真的行才能被插入VT2;

3.OUTER(JOIN) :如果指定了outer join(相对于cross join 或 inner join),保留表(preserved table)中未找到匹配的行将作为外部行添加到VT2,生成T3,如果From子句包括两个以上的表,则对上一联接生成的结果表和下一个表重复执行步骤1到3,知道处理完所有的表为止。

4.对VT3应用where筛选器,只有使<where_condition>为真的行才被插入VT4。

5.Group By :按Group By 子句中的列列表对VT4中的行进行分组,生成VT5。

6.Cube|rollup:把超组(supergroup)插入VT5,生成VT6。

 

   

相关文章:

  • 2021-12-22
  • 2021-07-12
  • 2022-01-20
  • 2021-10-06
  • 2022-01-26
  • 2021-08-16
  • 2022-12-23
  • 2021-10-31
猜你喜欢
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
相关资源
相似解决方案