Skip to content

1082. Sales Analysis I

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
WITH
  SellerToPrice AS (
    SELECT seller_id, SUM(price) AS price
    FROM Sales
    GROUP BY 1
  )
SELECT seller_id
FROM SellerToPrice
WHERE price = (
    SELECT MAX(price)
    FROM SellerToPrice
  );