首页 > 代码库 > MySQL sql 执行步骤
MySQL sql 执行步骤
基本步骤是
1.from
2.join on
3.where
4.group by
5.having
6.order by
7.select
8.distinct ,sum,...
9.limit
join table 一定要有索引不然就是笛卡尔积了。
inner join 的特别
正确来讲 mysql 会先base on where 的过滤条件选出最好的table join table 方式 。 那么它是会先过滤掉 where 才开始join 的for 1st table .
不过我们通常是用 straight join 来控制它,以免我们不知道最后会是那个表被join出来 .
having 是过滤掉 group by 之后的rows , 这时候的过滤可以使用count sum 那些,在where时候是不能使用的。
MySQL sql 执行步骤
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。