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 commit, rollback, and savepoint?

565


What is a field in a database?

563


How do you optimize a query?

524


How much does sqlite cost?

549


Can we join same table in sql?

516






what is bcp? When is it used?

570


What is varchar data type in sql?

511


What is an inconsistent dependency?

572


What is an ndf file?

516


What is the difference between a primary key and a unique key?

552


how to rename an existing column in a table? : Sql dba

502


what is a foreign key ? : Sql dba

599


What do you mean by dbms? What are its different types?

550


what is rollback? : Sql dba

584


What is package in pl sql with an examples?

536