Tuesday, 10 April 2012

MINUS Operator in SQL

It will display output unique to first query.

Syntax:
<Component query >
MINUS
<Component query>


Example:
SELECT job FROM emp WHERE deptno = 10
MINUS
SELECT job FROM emp WHERE deptno = 20;


-- The above query displays the job present only in first query, should not be in the result of second query.


Click on for practice questions
Click on for interview questions

No comments:

Post a Comment

Do you want to comment