Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person.
+----+---------+
| Id | Email |
+----+---------+
| 1 | a@b.com |
| 2 | c@d.com |
| 3 | a@b.com |
+----+---------+
For example, your query should return the following for the above table:
+---------+
| Email |
+---------+
| a@b.com |
+---------+
Note: All emails are in lowercase.
用exists
select distinct Email from Person p1 where exists (select Id from Person p2 where p1.Email = p2.Email and p1.Id != p2.Id);
用group by
select Email from Person group by Email having count(Email) > 1;
Duplicate Emails的更多相关文章
- [LeetCode] Delete Duplicate Emails 删除重复邮箱
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique ...
- [LeetCode] Duplicate Emails 重复的邮箱
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- LeeCode(Database)-Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- Leetcode 182. Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- [SQL]LeetCode182. 查找重复的电子邮箱 | Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- LeetCode DB: Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- 【SQL】182. Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- LeetCode - Duplicate Emails
Description:Write a SQL query to find all duplicate emails in a table named Person. 找出表中重复的Email. # ...
- 182. Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
随机推荐
- Linux内核解析
一.Linux内核 一个完整可用的操作系统主要由 4 部分组成:硬件.操作系统内核.操作系统服务和用户应用程序,如下图所示: 用户应用程序:是指那些自处理程序. Inter ...
- Linux系统挂载FAT32的U盘
1:将U盘插入USB接口,检查是否插好 2:用fdisk命令检查分区和USB设备信息 [root@yhwang ~]# fdisk -l Disk /dev/sda: 1000.2 GB, 10002 ...
- Leetcode:206. Reverse Linked List
这题直接ac掉 class Solution { public ListNode reverseList(ListNode head) { ListNode prev = null; while(he ...
- Entity Framework Code-First(9):DataAnnotations
DataAnnotations in Code-First: EF Code-First provides a set of DataAnnotation attributes, which you ...
- C#结构体指针的定义及使用详解(intptr的用法)
在解析C#结构体指针前,必须知道C#结构体是如何定义的.在c#中同样定义该结构体. C#结构体指针之C#结构体的定义: [StructLayout(LayoutKind.Sequential)] pu ...
- Ansible Jinja2使用
常用方法 ternary 根据结果的真假来决定返回值 - name: Set container backend to "dir" or "lvm" based ...
- eros --- Windows Android真机调试
1.下载并安装JDK 2.下载并安装Android Studio 上面两项不管用weex还是eros都是前置条件,度娘有大量教程. 开始eros 手脚架安装: $ npm i -g eros-cli ...
- 2018ICPC徐州区域赛网络赛G(VECTOR+SET,模拟)
#include<bits/stdc++.h>using namespace std;int x,y;vector<int>v1,v2;long long solve(vect ...
- Ocelot(四)- 认证与授权
Ocelot(四)- 认证与授权 作者:markjiang7m2 原文地址:https://www.cnblogs.com/markjiang7m2/p/10932805.html 源码地址:http ...
- Oracle12c 数据库找到Scott账户的方法
因为Oracle12c数据库中引入了CDB与PDB的概念(具体介绍请参考潇湘隐者的文章http://www.cnblogs.com/kerrycode/p/3386917.html),我们之前常用的练 ...