Customers Who Never Order
Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.
Table: Customers.
±—±------+
| Id | Name |
±—±------+
| 1 | Joe |
| 2 | Henry |
| 3 | Sam |
| 4 | Max |
±—±------+
Table: Orders.
±—±-----------+
| Id | CustomerId |
±—±-----------+
| 1 | 3 |
| 2 | 1 |
±—±-----------+
Using the above tables as example, return the following:
±----------+
| Customers |
±----------+
| Henry |
| Max |
±----------+
Solution
# Write your MySQL query statement below
SELECT Name AS CustomersFROM Customers c LEFT JOIN Orders o ON c.Id = o.CustomerIdWHERE o.Id IS NULL
Customers Who Never Order相关推荐
- [SQL]LeetCode183. 从不订购的客户 | Customers Who Never Order
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ ➤微信公众号:山青咏芝(shanqingyongzhi) ➤博客园地址:山青咏芝(https://www.cnblog ...
- LeetCode:183.Customers Who Never Order
题目: Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQ ...
- 【Leetcode】Customers Who Never Order
题目链接:https://leetcode.com/problems/customers-who-never-order/ 题目: Suppose that a website contains tw ...
- LeetCode: 183. Customers Who Never Order
LeetCode: 183. Customers Who Never Order 题目描述 Suppose that a website contains two tables, the Custom ...
- 183. Customers Who Never Order
原题链接:https://leetcode.com/problems/customers-who-never-order/description/ 做完这道题目我才发现,我跟不就不懂 in, exis ...
- 183. Customers Who Never Order没有下过订单的顾客MySQL
假设一个网站包含两个表,Customers表和Orders表.编写SQL查询以查找所有没订购任何商品的客户. customers orders Output 用到left outer join: s ...
- LeetCode-183. 从不订购的客户( Customers Who Never Order)。
某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: +----+-------+ | Id | Name ...
- leetcode 183. Customers Who Never Order
题意:查找没有点过单的客人 题目链接:https://leetcode.com/problems/customers-who-never-order/ select Name from Custome ...
- Leetcode#183. Customers Who Never Order
题目描述:查找没有预定(orders)的顾客(customers) 普通方法: select Name as Customers from Customers c where c.Id not in ...
最新文章
- directx 双缓冲 运动 闪烁_24期0利率 | BMW超值福袋开启“双11”购车狂欢节!!
- Algorithm:论一个产品经理的十八般武艺
- springboot去掉git版本控制_关于 Git 提交这些规范,你都遵守了吗?
- python中numpy与matlab的对应关系
- noclassdeffounderror java,从终端运行Java文件时出现java.lang.NoClassDefFoundError
- 基础笔试编程题(jz)
- eclipse启动失败:An internal error occurred during: reload maven project
- 【第一组】典型场景:学生选课时查看选课推荐,教师推荐
- 属性值动态调整_这可能是你见过最牛的CAD粗糙度动态块了!
- Hive常见的属性配置
- 英文简历中的自我评价
- 删除进程id_Mysql新增删除数据失败,提示锁表
- 基于 Android Architecture Components 的 MVVM 浅析
- 整数实例hdu2041(超级楼梯)
- Java MyEclipse 实现微信跳一跳小程序
- WebRTC基本概念
- url 编码(percentcode 百分号编码)
- 高通骁龙各代处理器解析
- linux删除用户命令userdel
- 当前佛教界的乱相之一就是以凡滥圣、惑乱人心
热门文章
- 为你的网站添加 htpps
- Android实现图片轮播
- 海德汉 LSV2 协议采集 2
- 病毒防治:清除***从它的寄生地开始
- 国培计算机音乐教学设计作业,2017国培计划教学设计
- Moment.js 2.22.2 源代码
- ai中如何插入签名_怎么将CAD中插入图片的多余部分抠掉?如何设置透明效果?...
- 移动应用/APP的测试流程及方法
- Socket_Tcp加密文件传输系统
- python批量打印pdf_通过Dynamo批量打印PDF图纸