각 상품별 2019-08-16일자 기준으로 변경된 가격을 출력하라.
만약 16일 이후 변경되었다면,디폴트 가격은 10
WITH cte AS
(SELECT *, RANK() OVER (PARTITION BY product_id ORDER BY change_date DESC) AS r
FROM Products
WHERE change_date<= '2019-08-16')
SELECT product_id, new_price AS price
FROM cte
WHERE r = 1
UNION
SELECT product_id, 10 AS price
FROM Products
WHERE product_id NOT IN (SELECT product_id FROM cte)