当前位置:网站首页>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
边栏推荐
- 多个gcc/glibc版本的共存及指定gcc版本的编译
- Kubernetes基础入门(完整版)
- Set集合与Map集合
- Deploy LVS-DR cluster [experimental]
- win云服务器搭建个人博客失败记录(wordpress,wamp)
- webtrc 中VideoAdapter类中的作用及局限
- 关系型数据库-MySQL:二进制日志(binlog)
- ISCC2021———MISC部分复现(练武)
- 程序员的财富观
- The cost of automated testing is high and the effect is poor, so what is the significance of automated testing?
猜你喜欢
随机推荐
关系型数据库-MySQL:约束管理、索引管理、键管理语句
flink-sql大量使用案例
Kubernetes集群安装
LCP 17. Quick Calculation Robot
显式调用类的构造函数(而不是用赋值构造),实现一个new操作
thymeleaf中onclick事件动态传递参数问题
组原模拟题
剑指 Offer 2022/7/3
判断字符串是否有子字符串重复出现
大龄程序员的心理建设
lmxcms1.4
跨域问题的解决
纳米级完全删除MYSQL5.7以及一些吐槽
phpexcel导出数据为xml
Kubernetes基本入门-概念介绍(一)
Kubernetes基础入门(完整版)
关于事件捕获和事件冒泡的顺序,以及如何处理事件冒泡带来的影响
ES6 Const Let Var的区别
MediaCodec支持的类型
keep-alive的使用及详解