select * from temp1
select num,COUNT(1) from temp1 group by num
update T_bGoodsInfo set T_bGoodsInfo.GoodsStyle = temp1.htype from
T_bGoodsInfo,temp1 where T_bGoodsInfo.GoodsCode = temp1.num and T_bGoodsInfo.CustCode='GD01'
select * from T_bGoodsInfo where CustCode='GD01' and GoodsCode in (
select num from temp1)
select GoodsStyle ,htype from
T_bGoodsInfo inner join temp1 on GoodsCode = num
where T_bGoodsInfo.CustCode='GD01' and GoodsStyle!=htype
select * from T_CustomerOrder
where CustomerName like '%德司达%';
select GoodsCode,GoodsStyle ,htype from
T_wStock inner join temp1 on T_wStock.GoodsCode = dbo.temp1.num
where T_wStock.CustCode='GD01' and dbo.T_wStock.GoodsStyle!=dbo.temp1.htype
GROUP BY GoodsCode,GoodsStyle ,htype