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 how to send email from sql database?

555


How to convert numeric expression data types by assignment operations?

515


What are the types of joins in sql?

553


What is the current pricing model of SQL Azure?

88


What are “lock” hints?

585






where can you add custom error messages to sql server? : Sql server administration

573


What is transaction server explicit transaction?

540


Can we take the full database backup in log shipping?

536


write an SQL query to list the employees who joined in the month of January?

1140


What are dml triggers and types of dml triggers?

543


Which are new data types introduced in sql server 2008?

594


What is catalog views?

603


Explain error and transaction handling in sql server?

495


Define synonym?

726


What are the types of dml?

548