题目标签:

  题目给了我们 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. SQl 分组后按照某一列拼接字符串

    /* 分组之后拼接字符串 */ ;with t as( SELECT WorkflowId,Remark FROM dbo.OperatorAutomationProcess GROUP BY Wor ...

  2. posix_rpi_common.cmake学习

    # This file is shared between posix_rpi_native.cmake 这个文件在posix_rpi_native.cmake和posix_rpi_cross.cma ...

  3. AMS算法

    #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 1000//采样点的个数 #defi ...

  4. 资源-.Net-ASP.NET:ASP.NET资源列表

    ylbtech-资源-.Net-ASP.NET:ASP.NET资源列表 ASP.NETFree. Cross-platform. Open source.A framework for buildin ...

  5. maven学习整理-进阶知识

    在maven的阶知识主要学习的是maven在eclipse中的使用.依赖相关的问题.继承(父子工程).统一版本管理.聚合等相关知识 1.maven在eclipse中的使用 由上篇基础知识学习到怎样下载 ...

  6. jeecg随笔 -- 实体关联属性的设计

    转载:https://www.iteye.com/blog/1868620 在jeecg 里 ,是根据数据库生成实体的,很多关联关系需要自己进行进一步整理才能满足我们的业务需求 例如外键关系 由于很多 ...

  7. 浅谈HP-Socket在物联网的应用

    原文链接:https://my.oschina.net/chrisforbt/blog/1669746 一.应用背景 去年公司成立了个项目——<智慧用电安全隐患监管服务平台>,计划是开发一 ...

  8. Leetcode刷题——007.整数反转

    上代码: #include <cmath> class Solution { public: int reverse(int x) { ; long long tx=llabs(x); ) ...

  9. wpf中datagrid绑定数据源发生改变

    1.若datagrid绑定的数据源是同一个的话,即使里面的数据不同.页面也不会刷新,则需要重置数据源,再绑定.处理如下: datagrid1.ItemsSource=ListModule; 若List ...

  10. 使用promise构建一个向服务器异步数据请求

    function getJSON(Url){ return new Promise((resolve,reject)=>{ request= new XMLHttpRequest(); requ ...