目前已知商店和每日的商品库存信息
如何查询9月1号、2号、3号都有商品的商店?
如果只是想查9月1号至3号都有商品的商店,那就太简单了,你可以这样查:
select 商店 from 库存表 where trunc(to_date(日期,'yyyy-mm-dd')) between date'2021-9-1' and date'2021-9-3' and 商品 is not null group by 商店;
将我上面伪代码中的中文表示换成实现的列和表即可。