Leetcode183. Customers Who Never Order
来源:互联网 发布:oracle数据库log文件 编辑:程序博客网 时间:2024/06/12 19:08
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 |
+———–+
大意就是找出另一张表不存在的
select Name as Customers from Customers cwhere c.IDnot in (SELECT CustomerId FROM Orders o)
阅读全文
0 0
- leetcode183-Customers Who Never Order
- Leetcode183. Customers Who Never Order
- Customers Who Never Order
- Customers Who Never Order
- Customers Who Never Order
- Customers Who Never Order
- Customers Who Never Order
- LeetCode | Customers Who Never Order
- Leetcode : Customers Who Never Order
- LeetCode Customers Who Never Order
- Leetcode Customers Who Never Order
- Leetcode: Customers Who Never Order
- 【Leetcode】Customers Who Never Order
- SQL-Customers Who Never Order
- 183. Customers Who Never Order
- 183. Customers Who Never Order
- 183. Customers Who Never Order
- MySQL-Customers Who Never Order
- JavaScript之拖拽功能、封装
- Android 7.0新签名机制
- NGUI学习笔记(六):结合Toggle的伸缩式滑动列表
- 炮兵阵地 POJ
- 实验五:JPEG解码
- Leetcode183. Customers Who Never Order
- React PropTypes 定义组件的属性类型和默认属性
- call和apply的区别
- 从零开始学_JavaScript_系列(47)——Reflect
- 重新开始的勇气
- 基础数据结构03:栈
- mysql表属性修改
- Hie with the Pie POJ
- 建造型——抽象工厂模式