UNION ALL

by Brad 5. November 2007 10:45
If you've ever done a UNION in SQL you may not have noticed that by default it actually does the same as a SELECT DISTINCT on the resulting data - so if you had the same 5 rows in two tables you'd get only 5 rows after the UNION. That's great most of the time, but what if you want all 10 rows? That's where UNION ALL comes in - that won't do a distinct and will get you every row.

Cheers Mr Sherwood for posing the question....

Tags:

Microsoft SQL Server 2005

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar