35 - 最后一个能进入巴士的人 -- sum(weight) over(order by turn) as total,根据turn升序,再求前面数的和 select person_name from ( select person_name,sum(weight) over(order by turn) as total from Queue ) new_Queue where total<=1000 order by total desc limit 1;