Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pull sums from 2 tables
Message
From
15/10/2007 14:53:24
 
 
To
15/10/2007 14:40:26
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01261037
Message ID:
01261097
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
OK....I started to reply, but Boris' 2nd answer should do the trick.

Bottom line -

- Don't use a straight LEFT JOIN against two tables where you have multiple rows per key on both sides - you'll get more enhanced-aggregation than Britney Spear's cup size in 1999.

- Avoid correlated subqueries - they look nice and readable, but they are as inefficient as, well, Britney's legal defense. Derived tables (or even CTEs in SQL 05) will usually perform much better.

Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform