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 / anil_abbireddy

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

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between primary and secondary key?

519


how can we find the number of rows in a table using mysql? : Sql dba

588


What is data control language (dcl)?

603


How to run sql statements through the web interface?

514


how tsql statements can be written and submitted to the database engine? : Transact sql

540






What is record data type?

518


What is the benefit of foreign key?

530


What is a database? Explain

598


Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?

538


What is an invalid partition table?

570


How to display the current date in sql?

603


How do I create a sql database?

526


What will you get by the cursor attribute sql%notfound?

596


Explain isolation levels. : Transact sql

579


What is sql analyzer?

547