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



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

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 data integrity

3 Answers   TCS, Fidelity,


How to access the current value and next value from a sequence?

6 Answers  


How many LONG columns are allowed in a table?

6 Answers   CTS,


What are the types of triggers ?

26 Answers   Aspire, BirlaSoft, TCS,


Store procedure will return a value?

4 Answers   eMids,






How many null values can be inserted in a coulmn whihc is unique constraint

7 Answers   Flextronics,


1. what is the exact use of hint in sql. 2. How we can avoid index scan in sql even though index is there in the table.

1 Answers   Polaris,


What can be a size of a pl/sql block? Is there any limit?

2 Answers  


hi sql gurus, here is my question 4 u. i wanna use triggers for sending reminder mail to all users who are registered to the site. if any one knws the code plz send me ans here : chayabs3@gmail.com thnx advance

1 Answers  


What is normalization ?

9 Answers   HCL, CTS, BirlaSoft,


cursor types? explain with example programs?

1 Answers   HP,


Write a query to find the name of employees those who have joined on Monday.(based on column hire_date)

12 Answers   Satyam,






Categories