-
Notifications
You must be signed in to change notification settings - Fork 4
LeetCode SQL 50 #21
Answered
by
iamAntimPal
IamShiwangi
asked this question in
Q&A
LeetCode SQL 50
#21
-
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
iamAntimPal
Mar 21, 2025
# Write your MySQL query statement below
SELECT a.person_name
FROM
Queue AS a,
Queue AS b
WHERE a.turn >= b.turn
GROUP BY a.person_id
HAVING SUM(b.weight) <= 1000
ORDER BY a.turn DESC
LIMIT 1;
for expaltion go to Solution and Explaination
Replies: 1 comment 1 reply
-
# Write your MySQL query statement below
SELECT a.person_name
FROM
Queue AS a,
Queue AS b
WHERE a.turn >= b.turn
GROUP BY a.person_id
HAVING SUM(b.weight) <= 1000
ORDER BY a.turn DESC
LIMIT 1;
for expaltion go to Solution and Explaination
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
Thank you
Beta Was this translation helpful? Give feedback.
All reactions
Answer selected by
IamShiwangi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment