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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 sum(qty) query problem

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2008-12-30 : 01:11:52
Hi,
i try to get the quanity group by size wise but i could not place the correct query below iam sending the coding i have follwing query
select * from mr_master
select * from mr_details
select * from tblstockitem
select * from tblsizemaster

select (select fldsizedesc from tblsizemaster where fldsizecode = b.fldsizecode) as size,sum(a.fldactualqty) from mr_details a , mr_master b where a.mrno=b.mrno group by a.fldsizecode

looking forward your valuable suggestions


Desikankannan

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-30 : 01:13:11
What is your question?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-30 : 01:15:47
learn to use ANSI join syntax

select m.fldsizedesc as size,sum(a.fldactualqty)
from mr_details a
join mr_master b
on a.mrno=b.mrno
join tblsizemaster m
on m.fldsizecode = b.fldsizecode
group by m.fldsizedesc
Go to Top of Page
   

- Advertisement -