LeetCode - Customers Who Never Order
Description:
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
一种比较高效的方法是左连接,左连接之后任然使用被连接的两个表或多个表来定位连接之后的表的数据。
# Write your MySQL query statement below
select Name
from (Customers c left join Orders o on c.Id=o.CustomerId)
where o.Id is null;
LeetCode - Customers Who Never Order的更多相关文章
- [LeetCode] Customers Who Never Order 从未下单订购的顾客
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
- LeetCode——Customers Who Never Order(灵活使用NOT IN以及IN)
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
- [SQL]LeetCode183. 从不订购的客户 | Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
- LeetCode:Binary Tree Level Order Traversal I II
LeetCode:Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of ...
- LeeCode(Database)-Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
- 【SQL】183. Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
- 183. Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
- DataBase -- Customers Who Never Order
Question: Suppose that a website contains two tables, the Customers table and the Orders table. Writ ...
- Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
随机推荐
- Android——网格视图 GridView
activity_activitygrid.xml <?xml version="1.0" encoding="utf-8"?> <GridV ...
- iOS开发小技巧--cell往左拖拽出现很多按钮的实现,仅仅适用于iOS8以后
// 往左拖拽cell出现多个按钮的实现,仅仅适用于iOS_8.0以后 - (NSArray<UITableViewRowAction *> *)tableView:(UITableVie ...
- android之存储篇_SQLite数据库入门
SQLite最大的特点是你可以把各种类型的数据保存到任何字段中,而不用关心字段声明的数据类型是什么. 例如:可以在Integer类型的字段中存放字符串,或者在布尔型字段中存放浮点数,或者在字符型字段中 ...
- Windoows窗口程序四
子窗口的创建 .创建时要设置父窗口句柄 .创建风格要增加WS_CHILD|WS_VISIBLE HWND CreateChild(LPSTR lpClassName,LPSTR lpWndName,H ...
- 【转】【Java/Android】Toast使用方法大全
Toast 是一个 View 视图,快速的为用户显示少量的信息. Toast 在应用程序上浮动显示信息给用户,它永远不会获得焦点,不影响用户的输入等操作,主要用于 一些帮助 / 提示.Toast 最常 ...
- 【转】【Linux】Linux 命令行快捷键
Linux 命令行快捷键 涉及在linux命令行下进行快速移动光标.命令编辑.编辑后执行历史命令.Bang(!)命令.控制命令等.让basher更有效率. 常用 ctrl+左右键:在单词之间跳转 ct ...
- http的GET和POST
本文主要内容 1. GET和POST方法介绍 2. 源代码分析 3. 结果分析 4. 例子参考及引用: http://www.cnblogs.com/zhijianliutang/archiv ...
- Spring 4 官方文档学习(十一)Web MVC 框架之locales
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-localeresolve ...
- C++函数的高级特性
对比于 C 语言的函数,C++增加了重载(overloaded).内联(inline).const 和 virtual 四种新机制.其中重载和内联机制既可用于全局函数也可用于类的成员函数,const ...
- C++ 程序可以定义为对象的集合
C++ 基本语法C++ 程序可以定义为对象的集合,这些对象通过调用彼此的方法进行交互.现在让我们简要地看一下什么是类.对象,方法.即时变量. 对象 - 对象具有状态和行为.例如:一只狗的状态 - 颜色 ...