LeetCode 183. Customers Who Never Order (从不订购的客户)

Posted jimmycheng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 (从不订购的客户)

LeetCode MySQL练习3(183/626/595/511/620/1873/627)

leetcode_sql_2

183. Customers Who Never Order--solution

183.Customers Who Never Order

183. Customers Who Never Order