题目标签:

  题目给了我们 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 (从不订购的客户)的更多相关文章

  1. leetcode 183. Customers Who Never Order

    select Name as Customers from Customers where Id not in (select CustomerId from Orders);

  2. [SQL]LeetCode183. 从不订购的客户 | Customers Who Never Order

    Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...

  3. LeetCode:183.从不订购的客户

    题目链接:https://leetcode-cn.com/problems/customers-who-never-order/ 题目 某网站包含两个表 Customers 表和 Orders 表.编 ...

  4. 183. Customers Who Never Order

    Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...

  5. 力扣(LeetCode)从不订购的客户-数据库题 个人题解

    SQL架构 某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: +----+-------+ | Id | ...

  6. sql 183. 从不订购的客户

    SQL架构 某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: +----+-------+ | Id | ...

  7. [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 ...

  8. 【SQL】183. Customers Who Never Order

    Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...

  9. [LeetCode] Customers Who Never Order 从未下单订购的顾客

    Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL qu ...

随机推荐

  1. css创建

    CSS 创建 当读到一个样式表时,浏览器会根据它来格式化 HTML 文档. 如何插入样式表 插入样式表的方法有三种: 外部样式表(External style sheet) 内部样式表(Interna ...

  2. badboy设置参数化

    概述 1.将录制的检查点设置参数化 2.然后回放看结果 ps.设置检查点教程请看上一篇badboy教程 第一:添加变量 第二:将循环次数.请求参数.检查点设置参数化 第三:设置完毕后,点击回放按钮进行 ...

  3. NX二次开发-BlockUI的Tree树控件

    关于BlockUI的Tree树控件只要研究UGOPEN里西门子官方的那个例子在结合去查NXOPEN的帮助基本就可以了.[不过我是看唐工的视频学会的,没办法自己领悟性不太强] //=========== ...

  4. NX二次开发-Block UI C++界面(表达式)控件的获取(持续补充)

    Expression(表达式)控件的获取 NX9+VS2012 #include <uf.h> #include <uf_modl.h> UF_initialize(); // ...

  5. Java数据结构----集合

    Java的集合可以分为两类, 第一类是以数组为代表,这类集合可以描述线性表类型的数据结构,以Collection为基类,其中自己用过或者了解的有 实现List接口的类:LinkedList,Array ...

  6. 转-C++之虚函数不能定义成内联函数的原因

    转自:https://blog.csdn.net/flydreamforever/article/details/61429140 在C++中,inline关键字和virtual关键字分别用来定义c+ ...

  7. C# 中如何输出双引号(转义字符的使用)

    实现效果: 输出这样的一个含有双引号的字符串 "hello" 方式一: 不用 @ 时转义      System.Console.WriteLine("\"he ...

  8. 拾遗:编译安装 vim

    在非 Gentoo/Funtoo 系的 Linux 发行版上,软件仓库里的 vim 包可能没有加入 python 特性支持,会造成部分插件无法正常使用 一.下载 vim 源码包 ftp://ftp.v ...

  9. 剑指offer——40字符串的排列

    题目描述 输入一个字符串,按字典序打印出该字符串中字符的所有排列.例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba. 输入描述: 输 ...

  10. adapter设计模式

    适配器设计模式 将一个类的接口转换成客户希望的另外一个接口.Adapter 模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作 例如:现在有一个220V的插口,而手机不能直接接上去,因为锂电 ...