SQL我在临时表中插入一个新列后,执行怎么就不显示表结果了,代码和图如下
select*into#productsku1fromTProductSkuwhereProductSkuIdin(selectproductskuidfrom#prod...
select * into #productsku1 from TProductSku where ProductSkuId in (select productskuid from #productskuqty)select b.ProductType as silo,a.ClassId1,a.ClassId2,b.ClassName as classid3,a.ProductSkuId,ProductSkuName,c.qty into #productsku2 from #productsku1 a left join TProductClass3 b on a.ClassId3=b.ClassIdleft join #productskuqty c on a.ProductSkuId=c.ProductSkuIdselect silo,ClassId1,ClassId2 ,sum(qty) as qty from #productsku2group by silo,ClassId1,ClassId2order by silo,ClassId1,ClassId2
select silo,ClassId1,ClassId2,sum(qty) as qty,convert(varchar ,(sum(qty)/sum(qty))*100) +'%' as percen
into #productsku9
from #productsku2
group by silo,ClassId1,ClassId2
order by silo,ClassId1,ClassId2 展开
select silo,ClassId1,ClassId2,sum(qty) as qty,convert(varchar ,(sum(qty)/sum(qty))*100) +'%' as percen
into #productsku9
from #productsku2
group by silo,ClassId1,ClassId2
order by silo,ClassId1,ClassId2 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询