3,491
社区成员
发帖
与我相关
我的任务
分享
select t.goods_id, sum (t.Quantity * t.UnitPrice) value
from goods t
where t.company_id <> 747474
group by t.goods_id
select t.goods_id, sum (t.Quantity * t.UnitPrice) value
from goods t
group by t.goods_id
having
sum (case when t.company_id=747474 then 1 else 0 end) = 0