题解 | #商品交易(网易校招笔试真题)#
商品交易(网易校招笔试真题)
https://www.nowcoder.com/practice/f257dfc1b55e42e19eec004aa3cb4174
#不管是内连接还是左右连接,只要存在重复值,一定是重复连接后返回到新表,也就是说左1,右2,肯定就是1X2 select distinct goods.id ,goods.name ,goods.weight ,a1.t1 as total from goods left join ( select * ,sum(count)over(partition by goods_id) as t1 from trans ) as a1 on goods.id = a1.goods_id where a1.t1>=20 and weight<50 order by goods.id