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 ...
随机推荐
- Dart编程实例 - Const 关键字
Dart编程实例 - Const 关键字 void main() { final v1 = 12; const v2 = 13; v2 = 12; } 本文转自:http://codingdict.c ...
- Sqlserver复杂查询
--联表修改 update xyzrb set xyzrb.xy_card=tablsb.card from xyzrb left join tablsb on xyzrb.xybh=tablsb.x ...
- 揭秘阿里云EB级大数据计算引擎MaxCompute
日前,全球权威咨询与服务机构Forrester发布了<The Forrester WaveTM: Cloud Data Warehouse, Q4 2018>报告.这是Forrester ...
- C++ STL(一)介绍及string
STL: C++标准模板库的简称,它是C++的一部份.标准C++库的所有的标识符都是在一个名为std的命名空间中定义的 在使用STL中相关模板时,需要包含相关头文件,然后using namespace ...
- idea 中使用dataBase插件
最近一段时间重新开始学习Java 使用IntelliJ 发现有个链接数据库插件挺好用的,并且反应速度还挺快的记录下. 点击步骤:View → Tool Windows → data 进行数据库链接 发 ...
- 一:unittest框架配合selenium工具之CSS_selector定位。
做了自动化测试这么久了,一直没有梳理到元素定位这一块的内容,其重要性不言而喻.趁着周末有时间,梳理一下. 1,通过id定位 driver.find_element_by_css_selector(&q ...
- linux centos6安装postgresql
参考:https://blog.csdn.net/zhu_xun/article/details/21234663 参考:https://www.cnblogs.com/jimcsharp/p/857 ...
- asp.net core网关Ocelot的简单介绍& Ocelot集成Identity认证
文章简介 Ocelot网关简介 Ocelot集成Idnetity认证处理 Ocelot网关简介 Ocelot是一个基于netcore实现的API网关,本质是一组按特定顺序排列的中间件.Ocelot内 ...
- ATM+购物车结构
ATM+购物车 1.需求分析 2.程序设计及目录设计 3.编写程序 4.调试程序
- Python移动自动化测试面试✍✍✍
Python移动自动化测试面试 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课程本身没问题,大家看的时候可以 ...