题目标签:

  题目给了我们 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. Access数据库中自动编号字段重置为1

    在清空一张ACESS数据库表后,在重添加数据之前,希望此表的自动编号能从1开始,怎么办呢? 下面的方法告诉我们,除了通过转存数据库表的方法外,还有几种更简单的方法: 方法一(前提:数据库表可带内容进行 ...

  2. win 解除鼠标右键关联

    点击「开始」→「运行」→「输入Regedit」→「确定」,打开注册表编辑器,找到子键: 「HKEY_CLASSES_ROOT\*\shellex\UltroEdit」,删除此项即可:

  3. 基于Netty的RPC架构学习笔记(十二):借助spring实现业务分离、聊天室小项目、netty3和4、5的不同、业务线程池以及消息串行化

    文章目录 借助spring实现业务分离(

  4. BZOJ 2460 & 洛谷 P4570 [BJWC2011]元素 (线性基 贪心)

    题目链接: 洛谷 BZOJ 题意 给定 \(n\) 个矿石,每个矿石有编号和魔力值两种属性,选择一些矿石,使得魔力值最大且编号的异或和不为 0. 思路 线性基 贪心 根据矿石的魔力值从大到小排序. 线 ...

  5. 大数运算之 Java BigInteger 的基本用法

    大数运算之 Java BigInteger 的基本用法 在程序设计竞赛中会遇到高精度运算的问题,C++没有高精度运算,只能手动模拟人工运算,手动实现高精度,而 java.math 包中的 BigInt ...

  6. pcre2 正则库

    \S+ 不能匹配到字符串末尾的最后一个字段

  7. node+webpack+vue的环境搭建

      一般第一次搭建环境的时候,多多少少还是会出点状况的.这个时候多去百度,看牛人怎么解决,然后跟着尝试,多试几遍还是能解决的. 先说一下我安装的过程吧 1.我一开始按照官网的来搭建,失败了.报错内容是 ...

  8. Redis数据结构之快速列表-quicklist

    链表 在Redis的早期版本中,存储list列表结构时,如果元素少则使用压缩列表ziplist,否则使用双向链表linkedlist // 链表节点 struct listNode<T> ...

  9. vue-cli中进行微信支付代码详解

    最近做微信支付,颇经历一番波折,这里总结一下,便于以后少走弯路: 在进行微信支付,除了需要公众号之外,你还需要一个微信商户.根据商户规则进行商户申请 这是公众号的基本开发配置,这里在微信授权的时候就已 ...

  10. 微信小程序中实现左右滑动图片翻页

    页面代码 <swiper class="container" indicator-dots="{{indicatordots}}" autoplay=&q ...