当前位置:网站首页>力扣(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;
边栏推荐
猜你喜欢
![2.hacking-lab脚本关[详细writeup]](/img/f3/29745761cd5ad4df84c78ac904ea51.png)
2.hacking-lab脚本关[详细writeup]

2022-06-17

集成学习概览

Introduction to MySQL 8 DBA foundation tutorial

2022-06-17

618 what is the secret of dominating the list again? Nike's latest financial report gives the answer

SPSS做Shapiro-Wilk正态分析

14.信号量的代码实现

Sus system availability scale

STM32 and motor development (upper system)
随机推荐
拆解美图SaaS:开着飞机换引擎
What are the popular frameworks for swoole in 2022?
Win11 arm系统配置.net core环境变量
最详细MySql安装教程
JSP webshell免杀——webshell免杀
STM32 and motor development (upper system)
Pywin32打开指定窗口
大华设备播放过程中设置播放速度
软件产品管理系统有哪些?12个最佳产品管理工具盘点
Record attributeerror: 'nonetype' object has no attribute 'nextcall‘
Lunix reallocates root and home space memory
Oracle notes
Hdu1236 ranking (structure Sorting)
Set the playback speed during the playback of UOB equipment
数据库字典Navicat自动生成版本
Disassembling Meitu SaaS: driving the plane to change the engine
PCL之滤波
全网显示 IP 归属地,是怎么实现的?
MySQL lethal serial question 3 -- are you familiar with MySQL locks?
nodejs+express+mysql简单博客搭建