34,590
社区成员
发帖
与我相关
我的任务
分享
InSt_Amt=(select isnull(sum(x.Fc_tot), 0)
from StInPoOrdD x
inner join PoOrdD o on x.OrderD_Id = o.OrderD_Id where o.OrderM_Id = b.OrderM_Id)
InSt_Amt=(select isnull(sum(x.Fc_tot), 0) as Fc_tot
from StInPoOrdD x
inner join PoOrdD o on x.OrderD_Id = o.OrderD_Id where o.OrderM_Id = b.OrderM_Id)
create table #temp(
A varchar(10) null,
b int null
)
insert into #temp
select 'Test',5 union
select 'Test',1 union
select 'Test2',2
select A,SUM(b) as qty from #temp group by A
select SUM(b) as qty from #temp group by A
select SUM(b) as qty from #temp