首页 > Linux操作系统 > Linux操作系统 > SQL执行顺序是什么样的
(1) FROM
(2) ON
(3)
(4) WHERE
(5) GROUP BY
(6) WITH {CUBE | ROLLUP}
(7) HAVING
(10) ORDER BY
其中要注意,JOIN要先于WHERE条件执行。
如:
select a.name,b.class,c.fund from
a,b,cc where a.id=b.id and a.lx=cc.lx(+) and cc.rp=1 ;
这里先执行连接a.id=b.id and a.lx=cc.lx(+),执行完毕后再执行where过滤cc.rp=1
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27203359/viewspace-738515/ ,如需转载,请注明出处,否则将追究法律责任。