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

i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this

0 Answers  


what is mean by forward declaration and where we'll use it.

4 Answers   TCS,


What are the Restrictions on Cursor Variables?

2 Answers  


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

3 Answers  


i want to display 1 to 10 numbers using one select statement.

18 Answers   Oracle, Nyros, HCL,






what is indexing, searching and user interface?

1 Answers   HCL,


Explain the usage of WHERE CURRENT OF clause in cursors ?

3 Answers  


What is an Integrity Constraint?

4 Answers  


what is switch column,colums cost in oracle?

0 Answers   Metric Stream,


Types of locks in database ?

8 Answers   HCL, TCS, Tieto,


in materialized view the structure will create immediately or not?

2 Answers   iFlex,


SELECT category, type, AVG(price) FROM products GROUP BY category, type ORDER BY 1, 2 If there are three distinct categories in the "products" table, and each one has five different types, how many rows are returned by the query above? 1. 1 row 2. 3 rows 3. 5 rows 4. 8 rows 5. 15 rows

3 Answers  






Categories