T-SQL语句处理顺序
如下所示:
(8) select (9) distinct (11) <top_specification> <select_list>
(1) from <left_table>
(3) <join_type> join <right_table>
(2) on <join_condition>
(4) where <where_condition>
(5) group by <group_by_list>
(6) with {cube|rollup}
(7) having <having_condition>
(10) order by <order_by_list>