Sunday 26 January 2020

Similarities and differences between UNION and UNION ALL in SQL server

Hi All,

Hope you all are doing good.

In this article, we will know about similarities and differences between UNION and UNION ALL.
UNION ALL example:
Select Id, Name, Email from tblIndiaCustomers
UNION ALL
Select Id, Name, Email from tblUKCustomers


UNION example
Select Id, Name, Email from tblIndiaCustomers
UNION
Select Id, Name, Email from tblUKCustomers

Similarity: Both UNION and UNION ALL, helps us combining the rows of tables.

Difference: UNION filters duplicate records from result set where as UNION ALL is not.

Thanks for reading my article.

No comments:

Post a Comment

Intoduction to Flutter

Hi All, I hope every one is doing good In this article, we will know about the introduction of Flutter.