T-SQL 101: 111 Using UNION and UNION ALL
There are times when you need to connect together two sets of results into a single result set. The UNION statement is the way we do that.
In the example shown above, I have two SELECT queries. Notice that I could just highlight either one of them, and run them, and I’d see those values. But if I run the whole query, I’ll get back a single set of results that combines data from each of the queries.
2025-02-08