不一样的Mayday: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