Open QuXiangjie opened 4 months ago
1204. Last Person to Fit in the Bus If I want to have a cumulative sum up. I can use the over function behind thesum and control it
SELECT person_name,turn, sum(weight) over (order by turn) AS cum FROM queue where cum<=1000 order by turn DESC limit 1;
1204. Last Person to Fit in the Bus If I want to have a cumulative sum up. I can use the over function behind thesum and control it