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

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

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

select 
t2.goods_id, 
t1.name,
t1.weight,
sum(t2.count)
from goods t1
join trans t2 on t1.id = t2.goods_id
group by t2.goods_id,t1.name,t1.weight
having t1.weight >= 20 and t1.weight < 50
order by t2.goods_id;

全部评论
分组后不是不能查询其他字段吗?请问为什么这里能查出来name和weight啊
点赞 回复 分享
发布于 2023-11-05 09:38 江苏

相关推荐

评论
点赞
收藏
分享

创作者周榜

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