題解 | #牛客的課程訂單分析(一)#
商品交易(網(wǎng)易校招筆試真題)
http://fangfengwang8.cn/practice/f257dfc1b55e42e19eec004aa3cb4174
select id,name,weight,total from goods , (select t.goods_id , sum(t.count) as total from trans t group by t.goods_id) ts where goods.id = ts.goods_id and (goods.weight<50 and ts.total > 20)
簡(jiǎn)簡(jiǎn)單單,照著條件寫就行