多表连接
- 交叉连接(笛卡尔积)
两个表中的所有情况的组合,不推荐!!没有意义
select * from emp,dept;
-
内连接
-
外连接
-
自连接
原理:先笛卡尔积,再判断where条件 捡去有用的数据展示
缺点:浪费资源 占内存,慢 性能差
-
层次连接 level
emp,dept
emp表
dept表
内连接 等值连接
--内连接:等值连接 where方式 inner join on 方式
select * from emp e,dept d where e.