Select top 50 (a.yuefen, a.seller_name) from (select concat(‘2019M’, month(dt)) as ‘yuefen’, seller_name, sum(gmv) as total From purchase Where month(dt) = 5 Group by seller_name order by total desc) as a Union all Select top 50 (b.yuefen, b.seller_name) from (select concat(‘2019M’, month(dt)) as ‘yuefen’, seller_name, sum(gmv) as total From purchase Where month(dt) = 6 Group by seller_name order by total desc) as b; 我综合了大佬们的发言,把我的代码发出来了,不知道能不能这样写,欢迎大佬们来指正。
点赞 评论

相关推荐

king327:要从现有项目中挖掘1-2个你解决过的具体技术难题 详细描述你的解决方案、技术选型理由和最终效果 这比罗列更多基础功能更有说服力
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务