题解 | #商品交易(网易校招笔试真题)#
商品交易(网易校招笔试真题)
http://www.nowcoder.com/practice/f257dfc1b55e42e19eec004aa3cb4174
SELECT
goods.id,goods.name,
goods.weight AS weight,
SUM(trans.count) AS total
FROM goods
LEFT JOIN trans
ON goods.id=trans.goods_id
GROUP BY goods.id,goods.name
HAVING total>20 AND weight<50
ORDER BY goods.id ASC
查看15道真题和解析