SET OPERATORS IN SQL

Ij
Posted by Ij under Oracle category on | Points: 40 | Views : 438
UNION
This will combine the records of multiple tables having the same structure.
Ex:SQL> select * from student1 union select * from student2;

UNION ALL
This will combine the records of multiple tables having the same structure but including duplicates.
Ex:SQL> select * from student1 union all select * from student2;

INTERSECT
This will give the common records of multiple tables having the same structure.
Ex:SQL> select * from student1 intersect select * from student2;

MINUS
This will give the records of a table whose records are not in other tables having the same structure.
Ex:SQL> select * from student1 minus select * from student2;

Comments or Responses

Login to post response