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

Why is a primary key important?

547


What is an implicit commit?

557


What is the importance of sqlcode and sqlerrm?

849


What is meant by truncate in sql?

522


What are different types of indexes?

508






Why do we use joins in sql?

500


What port does sql server use?

510


What is serial sql?

527


Will truncate release space?

517


What are different functions in sql?

519


what is unique key constraint? : Sql dba

570


What is a table partition?

595


what is the difference between truncate and drop statements? : Sql dba

554


What is a behavioral trigger?

517


How can I see all tables in sql?

546