Shalini Juneja
What is the difference between UNION and UNION ALL?
By Shalini Juneja in SQL Server on May 06 2011
  • vijay kumar singh
    May, 2011 9

    Union add two or more table data without repetition

    While Union all add two or more data with all repetitive data

    • 0
  • Shalini Juneja
    May, 2011 6

    1. UNION The UNION command is used to select related information from two tables, much like the JOIN command. However, when using the UNION command all selected columns need to be of the same data type. With UNION, only distinct values are selected.
    2. UNION ALL The UNION ALL command is equal to the UNION command, except that UNION ALL selects all values.
    The difference between Union and Union all is that Union all will not eliminate duplicate rows, instead it just pulls all rows from all tables fitting your query specifics and combines them into a table.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS