select item_id, buyer_id, sum(amt) as buyer_all_amt from A where where dt >= '20180701' and dt <= '20180930' and seller_id = 123  and  item_id in (select a.item_id from           (select item_id, sum(amt) as all_amt from A           where dt >= '20180701' and dt <= '20180930' and seller_id = 123            group by item_id            order by all_amt desc            limit 1)  a ) group by  item_id, buyer_id  order by buyer_all_amt desc limit 1
点赞 1

相关推荐

黑皮白袜臭脚体育生:简历统一按使用了什么技术实现了什么功能解决了什么问题或提升了什么性能指标来写会更好另外宣传下自己的开源仿b站微服务项目,GitHub已经410star,牛客上有完整文档教程,如果觉得有帮助的话可以点个小星星,蟹蟹
点赞 评论 收藏
分享
牛客网
牛客企业服务