LeetCode 183. Customers Who Never Order (从不订购的客户)
题目标签:
题目给了我们 Customers 和 Orders 两个表格,让我们找到 从没订购过的客户。
首先从Orders 得到 订购过的CustomerId,然后再去Customers 里找 没有出现过的 Id,返回名字。
Java Solution:
Runtime: 264 ms, faster than 53 %
Memory Usage: N/A
完成日期:06/01/2019
关键点:NOT IN
# Write your MySQL query statement below
SELECT Customers.Name AS Customers
FROM Customers
WHERE Customers.Id NOT IN (SELECT CustomerId FROM Orders);
参考资料:n/a
LeetCode 题目列表 - LeetCode Questions List
题目来源:https://leetcode.com/
LeetCode 183. Customers Who Never Order (从不订购的客户)的更多相关文章
- leetcode 183. Customers Who Never Order
select Name as Customers from Customers where Id not in (select CustomerId from Orders);
- [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:183.从不订购的客户
题目链接:https://leetcode-cn.com/problems/customers-who-never-order/ 题目 某网站包含两个表 Customers 表和 Orders 表.编 ...
- 183. Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
- 力扣(LeetCode)从不订购的客户-数据库题 个人题解
SQL架构 某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: +----+-------+ | Id | ...
- sql 183. 从不订购的客户
SQL架构 某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: +----+-------+ | Id | ...
- [LeetCode] 183. Customers Who Never Order_Easy tag: SQL
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 ...
- [LeetCode] Customers Who Never Order 从未下单订购的顾客
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...
随机推荐
- session控制登入权限
<?php session_start(); if(empty($_SESSION["uid"]))//判断SESSION是不是为空 { header("locat ...
- 【LeetCode 7】整数反转
题目链接 [题解] 没什么说的. 就注意一点. 可以在*10+n%10的时候. 顺便判断有没有溢出. (直接用longlong可真是机制..) [代码] class Solution { public ...
- bzoj1066题解
[解题思路] 考虑拆点,把每根石柱拆成两个点,具体可以理解为石柱底部和石柱顶部,能爬到石柱顶部的蜥蜴只有有限只,而且蜥蜴只有爬到了石柱顶部才能跳到其他石柱的底部. 这样,考虑如下建图: 将每个有蜥蜴的 ...
- Block 使用总结
- (void)testBlockWeakObj1 { UILabel *tl = [[UILabelalloc]init];//本地局部变量 __weak UILabel *weakTL = tl; ...
- MAC OpenGL 环境搭建
MAC OpenGL 环境搭建 基础库介绍 先要安装两个库一个是GLEW(OpenGL Extension Wrangler Library),另外一个是GLFW(Graphics Library F ...
- go gin
1.安装 go get -u github.com/gin-gonic/gin 2. package main import "github.com/gin-gonic/gin" ...
- jmter 5.1 中文
一.jmeter5.0下载解压后,默认的界面是英文版的,许多人觉得不方便,想要汉化,jmeter是不需要安装汉化包的,通过修改配置文件即可:1.找到jmeter解压后的文件夹,例如我是安装在D:\De ...
- Navicat 连接MongoDB 查询语句
https://www.cnblogs.com/viviman/archive/2012/11/21/2780562.html
- jquery中的ajax请求用法以及参数详情
url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址. type: 要求为String类型的参数,请求方式(post或get)默认为get.注意其他http请求方法,例如put和 ...
- ATM+购物车结构
ATM+购物车 1.需求分析 2.程序设计及目录设计 3.编写程序 4.调试程序