1.查询语句的逻辑执行顺序
执行1:from
执行2:on
执行3:join
执行4:where
执行5:group by
执行6:having
执行7:select
执行8:distinct
执行9:order by
执行10:top
2.实际写查询语句的顺序
执行7: select
执行8: distinct <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:having <having_condition>
执行9:order by <order_by_condition>
执行10:top <limit_number>