What is the difference among ...
What is the difference among ...
The SQL set operators UNION
, MINUS
, and INTERSECT
are used to combine the results of two or more SELECT
statements. Each operator has a distinct purpose and behavior:
SELECT
statements into a single result set.UNION
removes duplicate rows from the result set.UNION ALL
includes all rows from the combined SELECT
statements, including duplicates.SELECT column_name FROM table1
UNION
SELECT column_name FROM table2;
SELECT
statement that are not present in the second SELECT
statement.SELECT
statement.SELECT column_name FROM table1
MINUS
SELECT column_name FROM table2;
SELECT
statements.SELECT
statements.SELECT column_name FROM table1
INTERSECT
SELECT column_name FROM table2;
SELECT
statements must match.senior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào