【SQL必知必会】SQL13 检索并列出已订购产品的清单
1.题目链接
2.题目描述
【问题】编写SQL 语句,查找所有订购了数量至少100 个的 BR01、BR02 或BR03 的订单。你需要返回 OrderItems 表的订单号(order_num)、产品 ID(prod_id)和数量(quantity),并按产品 ID 和数量进行过滤。
3.题解
select
ois.order_num,
ois.prod_id,
ois.quantity
from
OrderItems ois
where
ois.quantity >= 100
and ois.prod_id in ('BR01', 'BR02', 'BR03');
OPPO公司福利 1147人发布
查看8道真题和解析