题解 | 商品交易(网易校招笔试真题)
商品交易(网易校招笔试真题)
https://www.nowcoder.com/practice/f257dfc1b55e42e19eec004aa3cb4174
with a as(select g.id,g.name,sum(t.count) as cc from goods as g join trans as t on g.id=t.goods_id group by g.id ) select goods.id,goods.name,goods.weight,a.cc as total from goods join a on goods.id=a.id where a.cc>20 and goods.weight<50;

