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

What does it mean to manipulate data?

661


How to write a query with an inner join in ms sql server?

649


Please explain what is “asynchronous” communication in sql server service broker?

578


Define constraints and give an example of their use?

646


List out the differences between global and local temp tables in sql server?

661






Why I am getting "the microsoft .net framework 2.0 in not installed" message?

594


Suggest a method of joining two tables.

704


What is indexed view?

680


Explain about extended stored procedure?

587


What is coalesce in sql server?

634


Difference between Logical Page and Physical Page in SSRS.

379


What is reference section?

588


Write a program to fetch first 10 records from a file?

676


What is the default Port No on which SQL Server listens?

716


Explain the rules for designing files and file groups in sql server?

638