题解 | #商品交易(网易校招笔试真题)#
商品交易(网易校招笔试真题)
https://www.nowcoder.com/practice/f257dfc1b55e42e19eec004aa3cb4174
#goods全表+总购买个数 #质量<50 #购买总数>20 select id ,name ,weight ,total from ( select distinct goods_id ,sum(count)over(partition by goods_id) total#购买总个数 from trans ) n join ( select * from goods where weight<50#质量<50 ) w on w.id=n.goods_id where total>=20#购买总数>20