当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
ISCC-2022
flink sql left join数据倾斜问题解决
Kubernetes基础入门(完整版)
lmxcms1.4
flink on yarn任务迁移
编程Go:学习目录
Commons Collections1
Programming hodgepodge (3)
8.30难题留坑:计数器问题和素数等差数列问题
Swoole学习(一)
IvNWJVPMLt
自动化运维工具Ansible(1)基础
NFT市场可二开开源系统
k3s-轻量级Kubernetes
【树 图 科 技 头 条】2022年6月27日 星期一 今年ETH2.0无望
flink-sql所有表连接器
IP地址查询
乱码解决方案
[原创]STL容器map和unordered_map性能,创建,插入,随机访问速度对比!
Kubernetes基本入门-集群资源(二)









