- cross join 笛卡尔积
- natural 自然连接(省略连接条件,自动匹配)
- using 子句(不常用)
select *
from emp
join dept using(deptno)
- on 子句(常用)
select ename,EMP.deptno,DEPT.dname
from emp
join dept on EMP.deptno=DEPT.deptno
- 左外连接(以join左边的表为主)
select ename,EMP.deptno,DEPT.dname
from emp
left outer join dept on emp.deptno=dept.deptno
- 右外连接(以join右边的表为主)
select ename,EMP.deptno,DEPT.dname
from emp
right outer join dept on emp.deptno=dept.deptno
- 全外连接(左+右)
select ename,EMP.deptno,DEPT.dname
from emp
full outer join dept on emp.deptno=dept.deptno
Markdown怎样引用图片
![Aaron Swartz](https://raw.githubusercontent.com/smshen/MarkdownPhotos/master/Res/test.jpg)
©code by sunjingbo
网友评论