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 offset in sql query?

593


Does truncate remove indexes?

559


Can we commit inside a trigger?

547


What does over partition by mean in sql?

531


What are data types in pl sql?

559






How do you respond to dementia behavior?

531


Where the sql database files are stored?

487


How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

644


Can you have more than one key in a database?

507


What is the need of a partition key?

530


what is rollback? : Sql dba

591


What is a temporal data type?

593


What is $$ in sql?

553


What is form and report?

517


Can we alter stored procedure?

542