Interview Questions   Tutorials   Discussions   Programs   

DB2 - What is UNION,UNION ALL?




340
views
asked mar August 3, 2014 05:52 AM  

What is UNION,UNION ALL?


           

1 Answers



 
answered By Mswami   0  
UNION: Eliminates the duplicates

UNION ALL: Retains the duplicates.

When DB2 encounters the UNION keyword, it processes each select / subselect to form an interim result table, then it combines the interim result table and deletes duplicate rows to form a combined result table working similar as a JOIN. If the option is to keep the duplicate values, then the UNION ALL keyword should be used.

Note: When including the UNION ALL in the same SQL statement as a UNION operator, however, the result of the operation depends on the order of evaluation. Where there are no parentheses, evaluation is from left to right.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview

 Write A Tutorials
Online-Classroom Classes
www.writeabc.com


  1 person following this question

  1 person following this tag

  Question tags

Asked 2 years and 3 months ago ago
Number of Views -340
Number of Answers -1
Last updated
3 years and 4 months ago ago

Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert