当前位置:网站首页>力扣(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;
边栏推荐
- 学习open62541 --- [66] UA_String的生成方法
- Flutter——Canvas自定义曲线图
- 点云投影图片
- 【付费推广】常见问题合集,推荐榜单FAQ
- 使用华为性能管理服务,按需配置采样率
- (5) Gear control setting of APA scene construction
- AI技术产业热点分析
- 12. Process synchronization and semaphore
- MongoDB-快速上手MongoDB命令行的一些简单操作
- [visual studio] visual studio 2019 community version cmake development environment installation (download | install relevant components | create compilation execution project | error handling)
猜你喜欢

Introduction to MySQL 8 DBA foundation tutorial

Flutter环境配置保姆级教程,让doctor一绿到底

Kustomize使用手册

简洁、快速、节约内存的Excel处理工具EasyExcel
![[SUCTF2018]followme](/img/63/9104f9c8bd24937b0fc65053efec96.png)
[SUCTF2018]followme

Dialogue Wu Gang: why do I believe in the rise of "big country brands"?

Hdu1234 door opener and door closer (water question)

SPSS做Shapiro-Wilk正态分析

Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer

使用华为性能管理服务,按需配置采样率
随机推荐
【ARK UI】HarmonyOS ETS的启动页的实现
【TS】1368- 秒懂 TypeScript 泛型工具类型!
转换YV12到RGB565图像转换,附YUV转RGB测试
Flutter——Canvas自定义曲线图
Importing tables from sqoop
UVM learning - object attribute of UVM phase
全网显示 IP 归属地,是怎么实现的?
从.bag文件中读取并保存.jpg图片和.pcd点云
【AppLinking实战案例】通过AppLinking分享应用内图片
js setTimeout()与面试题
Flutter环境配置保姆级教程,让doctor一绿到底
Stm32 et développement de moteurs (système supérieur)
简洁、快速、节约内存的Excel处理工具EasyExcel
KS009基于SSH实现宠物管理系统
数据库字典Navicat自动生成版本
华为联机对战服务玩家掉线重连案例总结
Rapid prototyping
Flink submitter
集成学习概览
MySQL environment configuration