Leetcode - 1082. Sales Analysis I

문제

Loading...
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

정답

SELECT seller_id FROM
(
    SELECT seller_id, SUM(price) AS total
    FROM Sales
    GROUP BY seller_id
) AS T1
WHERE total IN
(
    SELECT MAX(total) as max_total FROM ( 
        SELECT seller_id, SUM(price) AS total
        FROM Sales
        GROUP BY seller_id
    ) AS T2
)