Skip to content

2329. Product Sales Analysis V 👍

1
2
3
4
5
6
7
8
SELECT
  Sales.user_id,
  SUM(Sales.quantity * Product.price) AS spending
FROM Sales
INNER JOIN Product
  USING (product_id)
GROUP BY user_id
ORDER BY spending DESC;