今天爱分享给大家带来DQL语言-多表查询【七】,希望能够帮助到大家。
内连接
隐式内连接:select * from emp e1, dept d1 where e1.deptno = d1.deptno;
显示内连接:select * from emp e1 inner join dept d1 on e1.deptno = d1.deptno;
外连接
左外连接
隐式左外连接:select * from emp e1,dept d1 where e1.deptno = d1.deptno(+);
显示左外连接:select * from emp e1 left outer join dept d1 on e1.deptno = d1.deptno;
右外连接
隐式右外连接:select * from emp e1,dept d1 where e1.deptno(+) = d1.deptno;
显示右外连接:select * from emp e1 right outer join dept d1 on e1.deptno = d1.deptno;
全外连接:select * from emp e1 full outer join dept d1 on e1.deptno = d1.deptno;
交叉连接
隐式交叉连接:select * from emp, dept;
显示交叉连接:select * from emp e1 cross join dept d1;