Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

Help Me/Question What Is The Difference Between Union And Union All Sql Syntax?

Discussion in 'Database Management' started by steve taylor, Feb 20, 2016.

  1. steve taylor

    Yellow Belt

    Joined:
    Feb 12, 2016
    Messages:
    769
    Ratings:
    +25 / -0
    With the help of union operation we can combine two sets of similar type. In union operation by default repeated values are eliminated the purpose of the union operation are same in the SQL Query Union operation are used to combine the two or more attributes value of the relation. In which way the union all differ from Union?
     
  2. krishatg

    Yellow Belt

    Joined:
    Jan 16, 2016
    Messages:
    240
    Ratings:
    +14 / -0
    When we use Union between two tables it will union records of booth the tables but kept only one copy of the common records in the new table or view. But when we do Union all it will kept the records of both the tables as they are means multiple copies for the records even if they are common in both the table.
     
  3. VIVEK KUMAR

    Yellow Belt

    Joined:
    Mar 8, 2016
    Messages:
    300
    Ratings:
    +2 / -0
    Union means combining the two or more different table which have same attribute field. In union we can combine only the unique values and the repeated values are eliminated. Where as in the union all operation all the element are keep in the database .
     
  4. Swati Mishra

    Yellow Belt

    Joined:
    Dec 28, 2015
    Messages:
    644
    Ratings:
    +105 / -0
    The UNION operator is used to combine the result set of two or more SELECT statements.and the ALL keyword is allow the duplicate data in the table.
     
  5. johnsmith123

    Yellow Belt

    Joined:
    Dec 29, 2016
    Messages:
    136
    Ratings:
    +9 / -0
    The difference between Union and Union all is that Union all will not eliminate duplicate rows, instead it just pulls allrows from all tables fitting your query specifics and combines them into a table. A UNION statement effectively does a SELECT DISTINCT on the results set.

    Hotel in Ranchi|Website design company in Ranchi|
    Book Hotels in Ranchi
     

Share This Page