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

相关推荐

09-23 08:41
已编辑
门头沟学院 Java
牛客吹哨人:可恶!它越来越嚣张了...哨哥晚点统一更新到黑名单:能救一个是一个!26届毁意向毁约裁员黑名单https://www.nowcoder.com/discuss/1525833
点赞 评论 收藏
分享
想玩飞盘的菠萝蜜在春...:上交✌🏻也拒?
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务