码迷,mamicode.com
首页 > 其他好文 > 详细

183. Customers Who Never Order

时间:2018-03-22 13:39:12      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:com   esc   exists   leetcode   http   state   pre   题目   eve   

原题链接:https://leetcode.com/problems/customers-who-never-order/description/
做完这道题目我才发现,我跟不就不懂 in, exists, not in, not exists,exists 用都不会用:

# Write your MySQL query statement below
select Name as Customers from Customers where not exists (select CustomerId from Orders where Customers.Id = Orders.CustomerId);

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

183. Customers Who Never Order

标签:com   esc   exists   leetcode   http   state   pre   题目   eve   

原文地址:https://www.cnblogs.com/optor/p/8622852.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!