当前位置:网站首页>SQL练习 2022/6/30
SQL练习 2022/6/30
2022-08-04 05:28:00 【Provence°_博】
SQL练习 2022/6/30
182. 查找重复的电子邮箱
题干
代码思路
- group by 然后having判断数量大于一就可
select Email
from Person
group by email
having count(id)>1
- 使用 GROUP BY 和临时表
select Email from
(
select Email, count(Email) as num
from Person
group by Email
) as statistic
where num > 1;
183. 从不订购的客户
题干
代码思路
- 嵌套查询
select name as Customers
from Customers
where id not in
(
select CustomerId
from Orders
)
- 左连接,然后判断为null
select name as Customers
from Customers left join Orders
on Customers.id= Orders.CustomerId
where CustomerID is null
边栏推荐
猜你喜欢
随机推荐
FLV格式详解
程序、进程、线程、协程的概念及区别
超详细MySQL总结
OpenGLES 学习之帧缓存
flink-sql所有表连接器
win云服务器搭建个人博客失败记录(wordpress,wamp)
flink-sql所有数据类型
thymeleaf中onclick事件动态传递参数问题
k9s-终端UI工具
实际开发中左菜单自定义图标点击切换
攻防世界MISC—MISCall
Camera2 闪光灯梳理
Zend FrameWork RCE1
keep-alive的使用及详解
对象存储-分布式文件系统-MinIO-2:服务端部署
关系型数据库-MySQL:体系结构
什么是跨域和同源
phpexcel导出数据为xml
ReentrantLock(公平锁、非公平锁)可重入锁原理
跨域问题的解决









