首页 > 其他分享 >leetcode 183

leetcode 183

时间:2023-04-11 16:00:50浏览次数:38  
标签:customers Customers orders 183 CustomerId leetcode select

从不订购的客户

 

select c.Name as Customers from Customers c 
left join Orders o
on c.Id = o.CustomerId
where o.CustomerId is null

 

select customers.name customers from customers where customers.id not in (select orders.customerid from orders)

 

标签:customers,Customers,orders,183,CustomerId,leetcode,select
From: https://www.cnblogs.com/carlzhang19/p/17306515.html

相关文章

  • leetcode 181
    超过经理收入的员工 selecte1.nameasEmployeefromEmployeee1,Employeee2wheree1.managerId=e2.idande1.salary>e2.salary selecte1.nameasEmployeefromEmployeee1leftjoinEmployeee2one1.managerId=e2.idwheree1.salary>e2.salary......
  • 【LeetCode回溯算法#extra01】集合划分问题【火柴拼正方形、划分k个相等子集、公平发
    火柴拼正方形https://leetcode.cn/problems/matchsticks-to-square/你将得到一个整数数组matchsticks,其中matchsticks[i]是第i个火柴棒的长度。你要用所有的火柴棍拼成一个正方形。你不能折断任何一根火柴棒,但你可以把它们连在一起,而且每根火柴棒必须使用一次。如......
  • [LeetCode] 2390. Removing Stars From a String
    Youaregivenastring s,whichcontainsstars *.Inoneoperation,youcan:Chooseastarin s.Removetheclosest non-star charactertoits left,aswellasremovethestaritself.Return thestringafter all starshavebeenremoved.Note:Thei......
  • P1835 素数密度
    给定区间[L,R](1≤R<(1<<30) R−L≤1e6),请计算区间中素数的个数。筛出sqrt(R)的质数p,遍历L~R的数,看能否被p约分,也就是合数,打个标记 #include<iostream>#include<cstring>#include<cmath>#include<algorithm>usingnamespacestd;constintM=1e6+30;......
  • 差分数组-leetcode1094
    车上最初有 capacity 个空座位。车 只能 向一个方向行驶(也就是说,不允许掉头或改变方向)给定整数 capacity 和一个数组 trips , trip[i]=[numPassengersi,fromi,toi] 表示第 i 次旅行有 numPassengersi 乘客,接他们和放他们的位置分别是 fromi 和 toi 。这些位......
  • leetcode_打卡1
    leetcode_打卡1题目:1768.交替合并字符串解答:思路:模拟即可,字符串的提取:a.charAt(i)classSolution{publicStringmergeAlternately(Stringword1,Stringword2){Stringresult="";intm=word1.length();intn=word2.length();......
  • #yyds干货盘点# LeetCode程序员面试金典:合并两个有序链表
    题目:将两个升序链表合并为一个新的升序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。  示例1:输入:l1=[1,2,4],l2=[1,3,4]输出:[1,1,2,3,4,4]示例2:输入:l1=[],l2=[]输出:[]示例3:输入:l1=[],l2=[0]输出:[0]代码实现:classSolution{publicLis......
  • #yyds干货盘点# LeetCode面试题:编辑距离
    1.简述:给你两个单词 word1和 word2,请返回将 word1 转换成 word2所使用的最少操作数 。你可以对一个单词进行如下三种操作:插入一个字符删除一个字符替换一个字符 示例 1:输入:word1="horse",word2="ros"输出:3解释:horse->rorse(将'h'替换为'r')rorse->rose(......
  • leetcode 178
    分数排名selects1.score,count(distincts2.score)as`rank`fromScoresass1,Scoresass2wheres1.score<=s2.scoregroupbys1.idorderbys1.scoredesc mysql8.0下新增窗口函数dense_rank()selectscore,dense_rank()over(orderbyscoredesc)`ra......
  • leetcode 177
    第N高的薪水 CREATEFUNCTIONgetNthHighestSalary(NINT)RETURNSINTBEGINdeclareTintdefault0;SETT=N-1;RETURN(#WriteyourMySQLquerystatementbelow.selectifnull((selectdistinctsalaryfromEmployeeorderbysalarydesclimit......