当前位置:网站首页>Leetcode 182 Find duplicate email (2022.07.01)
Leetcode 182 Find duplicate email (2022.07.01)
2022-07-02 10:59: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]')
Write a SQL Inquire about , lookup Person All duplicate email addresses in the table .
Example :
±—±--------+
| Id | Email |
±—±--------+
| 1 | [email protected] |
| 2 | [email protected] |
| 3 | [email protected] |
±—±--------+
According to the above input , Your query should return the following results :
±--------+
| Email |
±--------+
| [email protected] |
±--------+
explain : All e-mails are in lowercase letters .
source : Power button (LeetCode)
link :https://leetcode.cn/problems/duplicate-emails
Method 1 : Use GROUP BY and HAVING Words and expressions
MySQL Submission :
# Write your MySQL query statement below
select Email
from Person
group by Email
having count(Email) > 1;
边栏推荐
猜你喜欢

LeetCode+ 76 - 80 暴搜专题

Open the encrypted SQLite method with sqlcipher

如何使用IDE自动签名调试鸿蒙应用

HDU1234 开门人和关门人(水题)

Hdu1228 a + B (map mapping)

全网显示 IP 归属地,是怎么实现的?

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

JVM garbage collector

Special topic of binary tree -- acwing 1589 Building binary search tree

使用sqlcipher打开加密的sqlite方法
随机推荐
(5) Gear control setting of APA scene construction
PCL 从一个点云中提取一个子集
Analysis of hot spots in AI technology industry
面对不确定性,供应链的作用
Oracle notes
12. Process synchronization and semaphore
洛谷 P4281 [AHOI2008]紧急集合 / 聚会(树上倍增 LCA)
UVM - usage of common TLM port
Jsp webshell Free from killing - The Foundation of JSP
华为游戏初始化init失败,返回错误码907135000
[visual studio] visual studio 2019 community version cmake development environment installation (download | install relevant components | create compilation execution project | error handling)
Oracle 笔记
学习open62541 --- [66] UA_String的生成方法
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
618 what is the secret of dominating the list again? Nike's latest financial report gives the answer
QT学习日记8——资源文件添加
Overview of integrated learning
P1055 [NOIP2008 普及组] ISBN 号码
Special topic of binary tree -- acwing 1589 Building binary search tree
【快应用】text组件里的文字很多,旁边的div样式会被拉伸如何解决