4. 查询2016年12月份哪些顾客买了iPhone 6s,显示顾客姓名,订单号,产品名称,购买日期
程序员文章站
2022-04-08 21:40:58
...
SELECT
cname,
oid,
pname,
odate
FROM
customer,
product,
orders
WHERE
product.pname='iPhone 6s'
AND product.pid = orders.pid
AND orders.cid = customer.cid
AND orders.odate > '2016-11-30'
AND orders.odate < '2017-01-01';