49 - 列出指定时间段内所有的下单产品





-- 指定2020年2月的方法
-- (1) order_date between '2020-02-01' and '2020-02-29'
-- (2) order_date like '2020-02%'
-- (3) DATE_FORMAT(order_date, "%Y-%m") = "2020-02"
-- (4) LEFT(order_date, 7) 或 substr(1, 7)
select
p.product_name,sum(unit) unit
from
Orders o left join Products p on p.product_id=o.product_id
where
o.order_date like '%2020-02%'
group by
o.product_id
having
sum(unit)>=100

















![[寄宿日记]韩漫日漫无删减完整版,免费在线观看漫画](https://img-blog.csdnimg.cn/direct/8c4cced528ca43499e1e6a9be52df94f.jpeg)
