add

About Me

My photo
Oracle Apps - Techno Functional consultant

Sunday, October 30

Joins In Oracle

Equi Join:
select empno,ename,sal,job,emp.deptno,dname,loc from  emp,dept where emp.deptno = dept.deptno;

cartesian Join:select empno,ename,sal,job,emp.deptno,dname,loc
from  emp,dept ;

Outer join:select empno,ename,sal,job,emp.deptno,dname,loc from  emp,dept where emp.deptno = dept.deptno(+);

select empno,ename,sal,job,emp.deptno,dname,loc from  emp,dept where emp.deptno(+) = dept.deptno;

self join :select worker.ename subordibate,
manager.ename superior
from emp worker,emp manager
where worker.mgr = manager.empno

select empno,ename,sal,job,emp.deptno,dname,loc
from emp, dept where emp.deptno = dept.deptno;

select empno,ename,sal,job,emp.deptno,dname,loc
from emp, dept where emp.deptno = dept.deptno(+);

select empno,ename,sal,job,emp.deptno,dname,loc
from emp, dept where emp.deptno(+) = dept.deptno;

select empno,ename,sal,job,emp.deptno,dname,loc
from emp, dept ;

select empno,ename,sal,job,deptno,grade
from emp, salgrade
where sal between losal and hisal;

select w.ename subor, m.ename sup
from emp w ,emp m
where w.mgr = m.empno;

No comments: