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
What is dbcc? Give few examples.
How to modify the underlying query of an existing view?
Why should you use or avoid select * statements?
What do you mean by data integrity?
What are the advantages of using cte?
As a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this?
Explain the difference between delete,drop and truncate in SQL Server?
Explain the purpose of indexes?
What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?
You want to implement the many-to-many relationship while designing tables. How would you do it?
what is difference between view and Dip.
How to execute a stored procedure in ms sql server?
how you can move data or databases between servers and databases in sql server? : Sql server administration
How to create user messages with print statements in ms sql server?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?