当前位置:网站首页>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;
边栏推荐
猜你喜欢

【AGC】构建服务3-认证服务示例

从.bag文件中读取并保存.jpg图片和.pcd点云

Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)

How to get the password of cpolar?

Read H264 parameters from mediarecord recording

Win11 arm系统配置.net core环境变量

2022爱分析· 国央企数字化厂商全景报告

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

Hdu1228 a + B (map mapping)

Kustomize使用手册
随机推荐
PCL之K-d树与八叉树
Introduction to MySQL 8 DBA foundation tutorial
js数组常用方法
2022爱分析· 国央企数字化厂商全景报告
Record attributeerror: 'nonetype' object has no attribute 'nextcall‘
4. Random variables
长投学堂上面的账户安全吗?
Thanos Receiver
PCL 点云转深度图像
C#中索引器
Win11 arm系统配置.net core环境变量
Learn open62541 -- [66] UA_ Generation method of string
QT学习日记8——资源文件添加
QT学习日记7——QMainWindow
二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
2022-06-17
How to get the password of cpolar?
二叉树专题--AcWing 1589. 构建二叉搜索树
Sus system availability scale
JSP webshell free -- the basis of JSP