https://leetcode.cn/problems/products-price-for-each-store/
写出一个 SQL 查询语句,查找每种产品在各个商店中的价格。
可以以 任何顺序 输出结果。
SELECT product_id
, sum(CASE
WHEN store = 'store1' THEN price
END) AS store1
, sum(CASE
WHEN store = 'store2' THEN price
END) AS store2
, sum(CASE
WHEN store = 'store3' THEN price
END) AS store3
FROM Products
GROUP BY product_id