ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

Which keyword used with UNION does not retain duplicate rows?

Answer & Solution
Correct Answer: Option D
This question is about combining the results of multiple SQL queries in MySQL.
The UNION keyword is used to combine the results of two or more SELECT statements. However, by default, UNION removes any duplicate rows that appear in the combined result.
To retain duplicate rows, we can use the ALL keyword with UNION. So, the answer to this question is Option A: ALL.
Here's a breakdown:
UNION: This combines the results of multiple queries, removing duplicates.
UNION ALL: This combines the results of multiple queries, including duplicates.
Option B: NARROW, Option C: STRICT are not valid keywords in this context.
Option D: DISTINCT is used to remove duplicate rows within a single SELECT statement, not with UNION.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.