SQL (Structured Query Language) Question:

Explain UNION, MINUS, UNION ALL and INTERSECT?

Tweet Share WhatsApp

Answer:

INTERSECT - returns all distinct rows selected by both queries. MINUS - returns all distinct rows selected by the first query but not by the second. UNION - returns all distinct rows selected by either query UNION ALL - returns all rows selected by either query, including all duplicates.

Download SQL PDF Read All 172 SQL Questions
Previous QuestionNext Question
Explain CONNECT BY PRIOR?What is the fastest way of accessing a row in a table?