题解 | #牛客的课程订单分析(一)#

商品交易(网易校招笔试真题)

http://www.nowcoder.com/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)

简简单单,照着条件写就行

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务