内连接查询 (select * from a join b on a.id = b.id) 与 关联查询 (select * from a , b where a.id = b.id)的区别

from a join b 与 from a, b 产生的临时表结果集 。

都是执行笛卡尔积即(select * from a cross join b )两表的行乘积数。

on :与取得结果集同步进行数据刷选及过滤。

where : 获得结果集之后,才进行数据刷选及过滤。

执行顺序:on在上游,where在中游,having在下游。

---------------------

原文:https://blog.csdn.net/l690781365/article/details/76261093

你可能感兴趣的:(内连接查询 (select * from a join b on a.id = b.id) 与 关联查询 (select * from a , b where a.id = b.id)的区别)