Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pull sums from 2 tables
Message
From
16/10/2007 11:23:35
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01261037
Message ID:
01261264
Views:
10
I like that idea. I'd like to do some tests for real world usage. The problem is that probably half of most developer's customers are still on SQL2000. (Basic question now which I should already know) How to determine the version of SQLServer (if a valid connection exists)?


>Sergey,
>
>To your question on this...
>
>
>SELECT * FROM mytable mt1
>  WHERE NOT EXISTS (SELECT * FROM mytable WHERE id = mt1.id)
>
>
>SQL 2005 now implements the ANSI EXCEPT (and INTERSECT) operators...
>
>
>SELECT Vendor.VendorID  FROM Purchasing.Vendor Vendor
>   EXCEPT
>        SELECT VendorID FROM Purchasing.PurchaseOrderHeader POHeader
>
>
>I've read posts where people implemented EXCEPT and gained some increase in performance, though others have said that performance is about about the same and that the execution plans are about the same (maybe the first group did some additional refactoring).
>
>But either way, since you brought up readability, I think you'd agree that EXCEPT is even simpler code! ;)
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform