UNION

External Article

UNION vs. UNION ALL in SQL Server

  • Article

Sometimes there is a need to combine data from multiple tables or views into one comprehensive dataset. This may be for like tables within the same database or maybe there is a need to combine like data across databases or even across servers. I have read about the UNION and UNION ALL commands, but how do these work and how do they differ?

2019-12-05

Technical Article

Union Forcing Distinct

  • Script

The use of union would seem to force a distinct in each of the select statements being unioned. The use multiple unions, with mixed union and union all clauses, seems to cause haphazard results.

1.67 (3)

You rated this post out of 5. Change rating

2013-05-14 (first published: )

914 reads

Blogs

A New Word: Proluctance

By

proluctance – n. the paradoxical urge to avoid doing something you’ve been looking forward...

10 reasons why IT certifications are still important

By

As someone who has spent over 20 years in the Software/Data Engineering area and...

Know Thy Platform

By

IT and data professionals, I implore you – know thy platform. All of it....

Read the latest Blogs

Forums

Estimated rollback completion: 0%. Estimated time remaining: 0 seconds

By xiaoluma

Greetings! I have a process that has been running for over a day (normally...

Need help read JSON file

By Adelia

Hello, I've JSON file format as following, { "acc_div": [ { "level1_code" : 1104,...

Troubleshooting sql issue where multiple sessions are involved

By vsamantha35

Hi All, We have an application that spawns multiple spid's, runs multiple multiple batches...

Visit the forum

Question of the Day

Filestream on Linux

I want to implement a Filestream table on SQL Server 2022 running on Linux. Can I do this?

See possible answers