当前位置:网站首页>leetcode day3 查找重复的电子邮箱
leetcode day3 查找重复的电子邮箱
2022-07-28 17:47:00 【wyqgg123】
182. 查找重复的电子邮箱
难度简单
SQL架构
编写一个 SQL 查询,查找 Person 表中所有重复的电子邮箱。
示例:
+----+---------+
| Id | Email |
+----+---------+
| 1 | [email protected] |
| 2 | [email protected] |
| 3 | [email protected] |
+----+---------+
根据以上输入,你的查询应返回以下结果:
+---------+
| Email |
+---------+
| [email protected] |
+---------+
说明:所有电子邮箱都是小写字母。
题解:
通过阅读题目我们可以得知此题我们可以使用分组查询,判断总数
这题也是比较简单我直接放sql代码
select Email
from Person
group by Email
having count(Email)>=2
需要先对数据进行分组查询,通过Emali分组,然后条件判断count(Email)的数量大于等于2的,这样查询的结果就是有重复的email。
边栏推荐
- WPF 实现带蒙版的 MessageBox 消息提示框
- 投资35.45亿元!格力集团参与小米产业基金
- Nokia expands its 5g agreement with BT and will become its largest wireless access device supplier
- MySQL性能测试工具sysbench学习
- C string to short[] method
- shared_ptr 和 make_shared 的使用
- MySQL8 Status Variables: Internal Temporary Tables and Files
- 诺基亚扩大与英国电信的5G协议,将成其最大无线接入设备供应商
- Rust Getting Started Guide (modules and engineering structures)
- Adobe Flash player 34.0.0.92 and available version modification methods (2021-01-23
猜你喜欢

在矩池云快速安装torch-sparse、torch-geometric等包

使用SaltStack自动化部署Zabbix

调用整数或字符数组函数里的参数应该传入啥

Business visualization - let your flowchart "run" (4. Actual business scenario test)

App自动化测试是怎么实现H5测试的

可转债概念表 x Notion 给你方便快捷的体验!

Sword finger offer II 109. unlock the password lock

Nips18 (AD) - unsupervised anomaly detection using geometric transformations using geometric augmentation

JS 批量添加事件监听onclick this 事件委托 target currentTarget onmouseenter onmouseover

SaltStack进阶
随机推荐
App自动化测试是怎么实现H5测试的
Convertible bond concept table x notation gives you a convenient and fast experience!
美国将提供250亿美元补贴,鼓励英特尔等芯片制造商迁回产线
SaltStack之数据系统
Pagoda panel construction novel CMS management system source code measurement - thinkphp6.0
C language cycle sentence strengthening exercises
SaltStack配置管理
lua语言的左对齐函数(手写)
How does app automated testing achieve H5 testing
华为入股南京芯视界,布局固态激光雷达芯片领域
SaltStack入门
New functions of ES6 string
[notes] Apocalypse: list of practical experience and reflection of product managers
这个客制化键盘,秀翻我了~
shared_ PTR and make_ Use of shared
Redis master-slave architecture (how to calculate sizeof function)
The peak rate exceeds 2gbps! Qualcomm first passed 5g millimeter wave MIMO OTA test in China
redis 主从架构(sizeof函数怎么计算)
【笔记】《启示录》:产品经理的实践经验与反省清单
Pytoch: quickly find the main diagonal elements and non diagonal elements of NxN matrix