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