当前位置:网站首页>力扣(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;
边栏推荐
- 全网显示 IP 归属地,是怎么实现的?
- How to get the password of cpolar?
- 华为AppLinking中统一链接的创建和使用
- JSP webshell free -- webshell free
- PCL之K-d树与八叉树
- 1287_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS
- [SUCTF2018]followme
- UVM factory mechanism
- 《实习报告》Skywalking分布式链路追踪?
- UVM learning - build a simple UVM verification platform
猜你喜欢
随机推荐
P1055 [NOIP2008 普及组] ISBN 号码
Mysql database remote access permission settings
Database dictionary Navicat automatic generation version
Windows环境MySQL8忘记密码文件解决方案
HDU1234 开门人和关门人(水题)
(5) Gear control setting of APA scene construction
4.随机变量
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
Flink calculates topn hot list in real time
Convert yv12 to rgb565 image conversion, with YUV to RGB test
PCL 从一个点云中提取一个子集
《MySQL 8 DBA基础教程》简介
618再次霸榜的秘密何在?耐克最新财报给出答案
The nanny level tutorial of flutter environment configuration makes the doctor green to the end
What is the significance of the college entrance examination
[visual studio] visual studio 2019 community version cmake development environment installation (download | install relevant components | create compilation execution project | error handling)
js promise. all
MySQL lethal serial question 3 -- are you familiar with MySQL locks?
Jsp webshell Free from killing - The Foundation of JSP
SQOOP 1.4.6 INSTALL