SQL语句执行顺序分析

    技术2022-05-19  20

    1.select 列名 from表名/视图名 where 条件.

    2.select 列名 from 表名/视图名 where 条件 group by (列) having 条件

    3.select 列名 from 表名/视图名 where 条件 group by (列) having 条件 order by 列表

    4.select 列名 from 表1 join 表2 on 表1.列1=表2.列1...join 表n on 表n.列1=表(n-1).列1 where 表1.条件 and 表2.条件...表n.条件

     

    1. 先from 后where 后select

    2. 先from后where 再group 再having 后select

    3. 先from后where 再group 再having 再select 后order

    4. 先from后join 再where 后select


    最新回复(0)