一、题目 二、代码 # Write your MySQL query statement below select person_name from ( select person_id , person_name ,sum(weight ) over (order by turn ) as total from Queue ) as table1 where table1.total<=1000 order by total desc limit 1 三、运行结果