Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pull sums from 2 tables
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01261037
Message ID:
01261273
Views:
10
>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! ;)

Sorry but your query is not comparable. It returns only one column not all.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform