Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sum issuw when joining the table

Author  Topic 

mkgmahi
Starting Member

24 Posts

Posted - 2011-06-16 : 04:04:09
I have to find the sum cubiccapacity of a particular warehouse. When i query it in capacity table it shows me the right value but when i join with other tables the result is multiplied. Let me know what needs to be done.


I have also tried using all kinds of join after validating the data

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-06-16 : 04:51:11
Aggregate the other tables in derived tables before the join or join to your current result as a derived table.
Can use a cte rather than a derived table for clarity if you wish.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -