1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

What is the difference between union and union all in oracle?

Discussion in 'SQL PL/SQL' started by kimipatel, Oct 2, 2012.

  1. kimipatel

    kimipatel Active Member

    Messages:
    53
    Likes Received:
    1
    Trophy Points:
    140
    Union n union all used in SQL/PLSQL? What is the difference between them? How we can used this Both function in Oracle? Could any one tell me in details?
     
  2. dariyoosh

    dariyoosh Forum Advisor

    Messages:
    118
    Likes Received:
    19
    Trophy Points:
    260
    Hello there,


    Actually the definition depends also to the type of the elements passed through these operators

    Generally speaking for simple atomic types:

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/queries004.htm#SQLRF52341

    But for elements of composite types like collections there is MULTISET UNION operator

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/operators006.htm#SQLRF51170

    In the links I provided you have examples.


    Regards,
    Dariyoosh

     
  3. kimipatel

    kimipatel Active Member

    Messages:
    53
    Likes Received:
    1
    Trophy Points:
    140
    Hi,

    Thanks for the Link N nice explanation n also for guide me. From your Link I can learn n understand so much about it.

    Thanks.