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; 我综合了大佬们的发言,把我的代码发出来了,不知道能不能这样写,欢迎大佬们来指正。
点赞 评论

相关推荐

程序员小白条:vibe你只要能cover住面试官问你很多深入的实现和选型方案的原因,以及怎么去检测优化效果的就行了
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务