Write a solution to get the names of products that have at least 100
units ordered in February 2020 and their amount.
Return the result table in any order.
The result format is in the following example.
HAVING
절의 내용을 WHERE
절에 올리는 실수를 반복한다.SELECT P.product_name, SUM(O.unit) as unit
FROM Products as P JOIN Orders as O ON P.product_id = O.product_id
WHERE O.order_date LIKE '2020-02%'
GROUP BY 1
HAVING SUM(O.unit) >= 100