Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fd18788

Browse files
committed
이예진: [SQL] Last Person to Fit in the Bus_241212
1 parent 174f6c1 commit fd18788

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SELECT
2+
person_name
3+
FROM (
4+
SELECT
5+
person_name, SUM(Weight) OVER(ORDER BY Turn) Total_Weight
6+
FROM Queue
7+
) sub
8+
WHERE Total_Weight <= 1000
9+
ORDER BY Total_Weight DESC
10+
LIMIT 1;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /