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

Can you have multiple SPs with the same name on a database?

6 Answers   CGI,


What are different types of refreshment techniques of materialised view

2 Answers  


I have the table like this S.No Name ID 01 Xyz 123 I want the result as 01Xyz123 How to write the query to retrieve the entire row data in a single column?

1 Answers  


Hi all, I am going to write oracle certification. Can anyone send me the dumps available if any for OCA exam? Its really very urgent, prompt response will help me alot..

8 Answers  


If you want a column to be part of the result set, after which SQL keyword does it belong? 1. SELECT 2. FROM 3. WHERE 4. GROUP BY 5. HAVING

10 Answers   TCS, HCL,






How to maintain the history of code changes of pl/sql?

2 Answers  


what is the difference between the query and corelated query

8 Answers   TCS, HSBC, IBM, Xenosoft,


If we declare constraints Unique and Not null on a single column then it will act as a Primary key, so what is the use of primary key??

3 Answers  


how to create temparary sequence

2 Answers   TCS,


what is the difference between implicit and explicit trigger

2 Answers   Tech Mahindra,


How to return multiple records from procedure?

2 Answers  


what are Dynamic SQL statements?

9 Answers  






Categories