当前位置:网站首页>力扣(LeetCode)182. 查找重复的电子邮箱(2022.07.01)
力扣(LeetCode)182. 查找重复的电子邮箱(2022.07.01)
2022-07-02 07:20:00 【ChaoYue_miku】
Create table If Not Exists Person (id int, email varchar(255))
Truncate table Person
insert into Person (id, email) values ('1', '[email protected]')
insert into Person (id, email) values ('2', '[email protected]')
insert into Person (id, email) values ('3', '[email protected]')
编写一个 SQL 查询,查找 Person 表中所有重复的电子邮箱。
示例:
±—±--------+
| Id | Email |
±—±--------+
| 1 | [email protected] |
| 2 | [email protected] |
| 3 | [email protected] |
±—±--------+
根据以上输入,你的查询应返回以下结果:
±--------+
| Email |
±--------+
| [email protected] |
±--------+
说明:所有电子邮箱都是小写字母。
来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/duplicate-emails
方法一:使用GROUP BY和HAVING字句
MySQL提交内容:
# Write your MySQL query statement below
select Email
from Person
group by Email
having count(Email) > 1;
边栏推荐
- "Matching" is true love, a new attitude for young people to make friends
- Use WinDbg to statically analyze dump files (summary of practical experience)
- 【ARK UI】HarmonyOS ETS的启动页的实现
- 软件产品管理系统有哪些?12个最佳产品管理工具盘点
- 大华设备播放过程中设置播放速度
- The URL in the RTSP setup header of the axis device cannot take a parameter
- MySQL数据库远程访问权限设置
- From Read and save in bag file Jpg pictures and PCD point cloud
- UVM - usage of common TLM port
- 数据库字典Navicat自动生成版本
猜你喜欢
Internet News: Tencent conference application market was officially launched; Soul went to Hong Kong to submit the listing application
Common methods of JS array
华为AppLinking中统一链接的创建和使用
Solutions to a series of problems in sqoop job creation
Shutter - canvas custom graph
HDU1228 A + B(map映射)
2022爱分析· 国央企数字化厂商全景报告
从MediaRecord录像中读取H264参数
UVM learning - build a simple UVM verification platform
一招快速实现自定义快应用titlebar
随机推荐
Is this code PHP MySQL redundant?
JS settimeout() and interview questions
PCL之滤波
"Matching" is true love, a new attitude for young people to make friends
Use WinDbg to statically analyze dump files (summary of practical experience)
使用华为性能管理服务,按需配置采样率
axis设备的rtsp setup头中的url不能带参
The nanny level tutorial of flutter environment configuration makes the doctor green to the end
JSP webshell免杀——webshell免杀
Shapiro Wilk normal analysis by SPSS
PCL 投影点云
华为游戏初始化init失败,返回错误码907135000
Lunix reallocates root and home space memory
JSP webshell免杀——JSP的基础
P1055 [NOIP2008 普及组] ISBN 号码
Internet News: Tencent conference application market was officially launched; Soul went to Hong Kong to submit the listing application
Mongodb quickly get started with some simple operations of mongodb command line
Disassembling Meitu SaaS: driving the plane to change the engine
How to get the password of cpolar?
Set the playback speed during the playback of UOB equipment