SELECT cargo_id
,九折=sum(case dis_id when 1 then cargo_price*dis_discount else 0 end)
,八折=sum(case dis_id when 2 then cargo_price*dis_discount else 0 end)
……
,原价=min(cargo_price)
FROM dbo.cargo,dbo.discounts
group by cargo_id
,九折=sum(case dis_id when 1 then cargo_price*dis_discount else 0 end)
,八折=sum(case dis_id when 2 then cargo_price*dis_discount else 0 end)
……
,原价=min(cargo_price)
FROM dbo.cargo,dbo.discounts
group by cargo_id
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货