Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sum on Union
Message
 
 
To
04/02/2013 11:31:42
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01565061
Message ID:
01565070
Views:
34
>>No, this is an OK way although I would rather use MERGE command instead. Also, if the inner select always returns 2 rows and you want it to return 2 rows, use UNION ALL instead of UNION.
>
>In this case, UNION ALL didn't change anything.
>
>Thanks for the reference for the merge.

I know, but you're doing an extra work using UNION as UNION also does distinct. Since in your case you never need a distinct result, you need to use UNION ALL.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform