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.

Answers were Sorted based on User's Feedback



What is the main difference between a UNION statement and a UNION ALL statement? 1. A UNI..

Answer / anil_abbireddy

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

Is This Answer Correct ?    11 Yes 0 No

What is the main difference between a UNION statement and a UNION ALL statement? 1. A UNI..

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

More SQL PLSQL Interview Questions

What is %type in pl sql?

0 Answers  


what is the difference between clustered and non clustered index in sql? : Sql dba

0 Answers  


How to retrieve a second highest salary from a table? Note:Suppose salaries are in duplicate values eg: Name Sal Malli 60000 Pandi 60000 Rudra 45000 Ravi 45000

10 Answers   Mind Tree, Polaris, Sonata,


what is the bond code in materialized view?

0 Answers  


types of exceptions and what is meant by pragma autonomous_transaction ?what is the use.

4 Answers   3i Infotech,






what is commit? : Sql dba

0 Answers  


Write a query to find second highest salary of an employee.

27 Answers  


how instead of triger is helpful for mutating tables errors handlling ?

2 Answers   Oracle,


define primary key & secondary key?

2 Answers  


Explain the commit statement.

0 Answers  


What is the difference between cluster and non-cluster index?

0 Answers  


What are the different types of joins and explain them briefly.

3 Answers  


Categories