当前位置:网站首页>力扣(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;
边栏推荐
- UVM learning - build a simple UVM verification platform
- VSCode工具使用
- MongoDB 学习整理(条件操作符,$type 操作符,limit()方法,skip() 方法 和 sort() 方法)
- 01 install virtual machine
- 面对不确定性,供应链的作用
- AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘
- 点云投影图片
- 学习open62541 --- [66] UA_String的生成方法
- SPSS做Shapiro-Wilk正态分析
- 《MySQL 8 DBA基础教程》简介
猜你喜欢

How to get the password of cpolar?
![[SUCTF2018]followme](/img/63/9104f9c8bd24937b0fc65053efec96.png)
[SUCTF2018]followme

The URL in the RTSP setup header of the axis device cannot take a parameter

Session cookies and tokens

对话吴纲:我为什么笃信“大国品牌”的崛起?

MongoDB 学习整理(条件操作符,$type 操作符,limit()方法,skip() 方法 和 sort() 方法)

从MediaRecord录像中读取H264参数

1287_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析

华为游戏初始化init失败,返回错误码907135000

JSP webshell免殺——JSP的基礎
随机推荐
Flink submitter
PCL Eigen介绍及简单使用
【快应用】Win7系统使用华为IDE无法运行和调试项目
VSCode工具使用
软件产品管理系统有哪些?12个最佳产品管理工具盘点
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
Session cookies and tokens
Disassembling Meitu SaaS: driving the plane to change the engine
Flutter——Canvas自定义曲线图
Analysis of hot spots in AI technology industry
PCL之K-d树与八叉树
12. Process synchronization and semaphore
Open the encrypted SQLite method with sqlcipher
MongoDB-快速上手MongoDB命令行的一些简单操作
【AGC】构建服务3-认证服务示例
【快应用】text组件里的文字很多,旁边的div样式会被拉伸如何解决
PCL之滤波
4.随机变量
数据库字典Navicat自动生成版本
首份中国企业敏捷实践白皮书发布| 附完整下载