Join the OracleApps88 Telegram group @OracleApps88to get more information on Oracle EBS R12/Oracle Fusion applications.

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.

Wednesday, October 23, 2013

SET operatior in Oracle



SELECT Empno, Ename
FROM Emp
WHERE Deptno = 10
UNION
SELECT Empno, Ename
FROM Emp
WHERE Deptno = 30
ORDER BY 1;

SELECT Empno, Ename, Job
FROM Emp
WHERE Deptno = (SELECT Deptno
                FROM Dept
                WHERE Dname = 'SALES' ) 
UNION
SELECT Empno, Ename, Job
FROM Emp
WHERE Deptno = (SELECT Deptno
                FROM Dept
                WHERE Dname = 'ACCOUNTING')
ORDER BY 1;

SELECT Empno, Ename
FROM Emp
WHERE Deptno = 10 
UNION ALL
SELECT Empno, Ename
FROM Emp
WHERE Deptno = 30
ORDER BY 1;

SELECT Empno, Ename
FROM Emp
WHERE Deptno = 10 
INTERSECT
SELECT Empno, Ename
FROM Emp
WHERE Deptno = 30
ORDER BY 1;

SELECT Empno, Ename, Deptno
FROM Emp
WHERE Deptno = 10 
MINUS
SELECT Empno, Ename, Deptno
FROM Emp
WHERE Deptno = 30
ORDER BY 1;

SELECT Job
FROM Emp
WHERE Deptno = 20 
UNION
SELECT Job
FROM Emp
WHERE Deptno = 30;

SELECT Job
FROM Emp
WHERE Deptno = 20 
UNION
SELECT Job
FROM Emp
WHERE Deptno = 30;

SELECT Job
FROM Emp
WHERE Deptno = 20 
INTERSECT
SELECT Job
FROM Emp
WHERE Deptno = 30;

SELECT Job
FROM Emp
WHERE Deptno = 20
MINUS
SELECT Job
FROM Emp
WHERE Deptno = 10;

SELECT ROWNUM, Ename
FROM Emp
WHERE ROWNUM < 7
MINUS
SELECT ROWNUM, Ename
FROM Emp
WHERE ROWNUM < 6;

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect