DynDeveloper.com

DynDeveloper.com

Sign Up Now!Log In
kkoehle@valuedrugco.com 10/2/2014 9:55:13 AM

SQL - help with a query

I have a set of data that I'm trying to summarize but it's not doing what I want. I have replicated the problem with the query below. The issue is that my data is not summarizing because of the item descriptions. Help?

declare @t table (itemnmbr varchar(31), itemdesc varchar(65), quantity int, xtndprce numeric(19,2))
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('100XLG', 'hammer'  , 1,6.00)
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('100XLG', 'hammer 2', 2,12.00)
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('128 SDRAM', 'saw'     , 1,5.00)
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('128 SDRAM', 'saw 2'   , 2,10.00)
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('24X IDE', 'pliers'  , 1,4.00)
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('24X IDE', 'pliers 2' , 2,8.00)
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('256 SDRAM', 'wrench'  , 1,3.00)
insert into @t (itemnmbr, itemdesc, quantity, xtndprce) values ('256 SDRAM', 'wrench 2', 2,6.00)
 
select i.itemnmbr, t.itemdesc, t.quantity, t.xtndprce
    from iv00101 i
        join @t t on t.itemnmbr = i.ITEMNMBR
 

Version: All
Section: SQL Scripts