题解 | 商品交易(网易校招笔试真题)
商品交易(网易校招笔试真题)
https://www.nowcoder.com/practice/f257dfc1b55e42e19eec004aa3cb4174
select goods.id, name, weight, sum(count) as total from goods join trans on goods.id = trans.goods_id group by goods_id having weight < 50 and total >20 order by goods_id
先分组再过滤用having