What is the main difference between a UNION statement and a
UNION ALL statement?

1. A UNION statement eliminates duplicate rows; a UNION
ALL statement includes duplicate rows.
2. A UNION statement can be used to combine any number of
queries; a UNION ALL statement can be used to combine a
maximum of two queries.
3. A UNION statement can only combine queries that have
parallel fields in the SELECT list; a UNION ALL statement
can combine queries with differing SELECT list structures.
4. A UNION statement cannot be used with aggregate
functions; a UNION ALL statement can be used with aggregate
functions.
5. There is no difference between the two statements; they
are interchangeable.

Answer Posted / menan

A UNION statement eliminates duplicate rows; a UNION
ALL statement includes duplicate rows.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the properties of a transaction?

584


Write a query to display the current date in sql?

528


What are the dml statements?

698


What is sequence in sql?

520


What does the sign mean in sql?

515






Is grant a ddl statement?

459


what is the difference between blob and text? : Sql dba

535


What are the syntax and use of the coalesce function?

563


What does desc stand for?

602


What is scalar function in sql?

540


Can we rollback after truncate?

575


What are triggers in sql?

587


Do triggers have restrictions on the usage of large datatypes, such as long and long raw?

698


How do I create a memory optimized filegroup?

537


how many tables will create when we create table, what are they? : Sql dba

551