SQL语句执行顺序

Mysql 语句编辑与执行顺序

SQL语句的编辑顺序

select [distinct]
from
join(如left join)
on
where
group by
having
union
order by
limit

SQL语句的执行顺序

from
on
join
where
group by
having
select
distinct
union
order by

join与where语句联合: 先执行join 形成笛卡尔积 然后再过滤 ????
having: 对group by的执行结果进行筛选,在group by 后执行

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页