题解 | #返回购买 的产品的所有顾客的电子邮件(二)#

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

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

首先查找prod_id为BR01的项

 select order_num
 from OrderItems
 where prod_id = 'BR01'

其次提取Orders表数据

最后用select子查询将Customers表和Orders表进行联结,从中取出符合条件的cust_email数据

select (select cust_email from Customers cs where os.cust_id = cs.cust_id)
from Orders os
where order_num in (
    select order_num
    from OrderItems
    where prod_id = 'BR01'
)

全部评论

相关推荐

牛客52071342...:不同的岗位,你得把不对口的内容删掉一些,优化一下,人家公司不管你有多少技能,他只看对他有用的技能,你得根据公司的需求简化简历
那些拿到大厂offer的...
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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