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....

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
posted @ Monday, November 05, 2007 10:45 AM | in Microsoft SQL Server 2005

Comments

No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  


Please add 8 and 2 and type the answer here: