What is the difference between UNION and UNIONALL?

Answer Posted / amit dixit

Just Above is OK except UNION ALL result modified..
Example:
Table 1 : First,Second,Third,Fourth,Fifth
Table 2 : First,Second,Fifth,Sixth

Result Set:
UNION: First,Second,Third,Fourth,Fifth,Sixth (This will
remove duplicate values)
UNION ALL:
First,First,Second,Second,Third,Fourth,Fifth,Fifth,Sixth
(This will repeat values)

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the first normal form(1nf)?

747


Why is normalisation important?

673


What are the 7 disadvantages to a manual system?

683


What is a hint?

738


Write a sql query to get zero records from a table having n number of records?

918






Do you know sql server 2008 backup compression?

743


What is outer join in sql server joins?

748


What are different types of views?

698


How to create percentile function?

124


What are the different authentication modes in sql server?

803


How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?

741


How can we call UDF(User Define Function) using C# code in ASP.net ?

6363


Do you know clustered and non-clustered index?

728


Explain what are partitioned views and distributed partitioned views?

710


query processing

1921