题解 | #商品交易(网易校招笔试真题)#
商品交易(网易校招笔试真题)
https://www.nowcoder.com/practice/f257dfc1b55e42e19eec004aa3cb4174
# 先作质量筛选
select *
from goods
where weight < 50
# 连接goods表和trans表再作购买数目的筛选
select goods_id id, name, weight, sum(count) total
from (
select *
from goods
where weight < 50
) t1
join trans t
on t1.id = t.goods_id
group by goods_id
having sum(count) > 20
order by id;
腾讯成长空间 6036人发布
查看4道真题和解析