What is the difference between UNION & UNION ALL operators?

8. What is the difference between UNION & UNION ALL operators?

  1. Combining the results of two select statements will be done using UNION whereas combined records from both queries are returned by UNION ALL operator.
  2. Combining the results of two select statements will be done using UNION ALL whereas combined records from both queries are returned by UNION operator.
  3. After performing the UNION operation, duplicate rows will not be removed whereas after performing the UNION ALL operation, duplicate rows will be removed.
  4. None of the above

Answer: A) Combining the results of two select statements will be done using UNION whereas combined records from both queries are returned by UNION ALL operator

Explanation:

Difference between UNION & UNION ALL operators is –

  1. Combining the results of two select statements will be done using UNION whereas combined records from both queries are returned by UNION ALL operator.
  2. After performing the UNION ALL operation, duplicate rows will not be removed whereas after performing the UNION operation, duplicate rows will be removed.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.