Operators:
UNION
: Combines results and removes duplicates.UNION ALL
: Combines results and retains duplicates.INTERSECT
: Returns common records from both SELECT statements.MINUS
: Returns records from the first SELECT statement that are not in the second.
Example:
SELECT first_name FROM employees
UNION
SELECT first_name FROM managers;
Explanation: This retrieves unique first names from both the employees
and managers
tables.
Leave a Reply