返回购买prod_id为BR01的产品的所有顾客的电子邮件

返回购买 prod_id 为 BR01 的产品的所有顾客的电子邮件(二)

https://www.nowcoder.com/practice/c7aa73afc41f4dfc925baebdd175c345

本题的考察点为多表连接 + 子查询,难度不大,个人感觉按照先子查询后连接的思路来做的话还是比较清晰。
select cust_email from Orders t1 join Customers t2 on t1.cust_id = t2.cust_id   //  使用join连接按照cust_id连接Orders表与Customers表
where order_num in 
(select order_num from OrderItems   //  使用子查询查找产品编号为“BR01”的订单编号
where prod_id = "BR01")

全部评论

相关推荐

牛客ID:561366855:期望薪资多少?难以相信这简历找不到工作。说明二本电子信息专业想对口就业非常难。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务