现在的位置: 首页 > 综合 > 正文

SQL语句执行顺序分析

2013年08月09日 ⁄ 综合 ⁄ 共 333字 ⁄ 字号 评论关闭

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. 先fromwhere 再group 再having 后select

3. 先fromwhere 再group 再having 再select 后order

4. 先fromjoin 再where 后select

抱歉!评论已关闭.