ArticleDirectory
- Non-equivalent join:
- Select empno, ename, Sal, grade from EMP, salgrade where Sal between salgrade. losal and salgrade. hisal;
Non-equivalent connection, external connection, self-connection, subquery
Non-equivalent join: Select empno, ename, Sal, grade from EMP, salgrade where Sal between salgrade. losal and salgrade. hisal; outer join: Select * from EMP, DEPT where Dept. deptno = EMP. deptno (+); in addition to the same department number, deptno, which is not included in Dept, is added to EMP. That is to say, the deptno field of the EMP table is extended.
Self-connection:
For example, find the employee's superior Mgr:
Select e1.ename, e2.ename from EMP E1, EMP E2 where e1.mgr = e2.empno;
Query employees in 5-8 order by employee number
Select * from (select rownum ID, empno, ename, Sal from EMP order by empno) where ID between 5 and 8;