What is UNION,UNION ALL?

Answers were Sorted based on User's Feedback



What is UNION,UNION ALL?..

Answer / sanjudharan

UNION : eliminates duplicates

UNION ALL: retains duplicates

Both these are used to combine the results of different
SELECT statements.

Suppose I have five SQL SELECT statements connected by
UNION/UNION ALL, how many times should I specify UNION to
eliminate the duplicate rows? -

Once.

Is This Answer Correct ?    22 Yes 9 No

What is UNION,UNION ALL?..

Answer / sandeep

Correct answer..

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More DB2 Interview Questions

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 employes........

10 Answers   IBM,


I have a main program (A) where we delete some rows in table in a cursor, and we commit it in sub program(B). What will happen - will we get an error or not?

2 Answers  


What are the various locks available?

5 Answers   CTS,


Which is faster delete or truncate?

1 Answers  


why we create view.

5 Answers  


Mention the location where the output received from explain statement is stored.

1 Answers  


I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

3 Answers  


What is db2 and what is the use of db2 optimizer?

1 Answers  


How to find primary key of a table in db2?

1 Answers  


What are simple, segmented and partitioned table spaces ?

1 Answers   TCS,


I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.

1 Answers  


What is db2 command?

1 Answers  


Categories