题解 | #获得积分最多的人(一)#

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

http://www.nowcoder.com/practice/f257dfc1b55e42e19eec004aa3cb4174

碰到这种题,就想到子查询。害。。。。。。

select g.id, g.name, g.weight, temp.total from 
goods g join

(select goods_id, sum(t.count) as total FROM trans t
GROUP BY goods_id HAVING total > 20) temp

ON g.id = temp.goods_id  where g.weight < 50 ORDER BY g.id;

全部评论

相关推荐

05-26 09:07
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务