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 |
+---------+ 需求:查询多次出现的邮箱

CREATE TABLE Person(
Id TINYINT UNSIGNED,
Email VARCHAR(20)
)ENGINE=MyISAM CHARSET=utf8;


SELECT Email
FROM Person
GROUP BY Email
HAVING COUNT(Email)>1

												

[LeetCode]-DataBase-Duplicate Emails的更多相关文章

  1. [LeetCode] Delete Duplicate Emails 删除重复邮箱

    Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique ...

  2. LeeCode(Database)-Duplicate Emails

    Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...

  3. Leetcode 182. Duplicate Emails

    Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...

  4. LeetCode - Delete Duplicate Emails

    Discription:Write a SQL query to delete all duplicate email entries in a table named Person, keeping ...

  5. LeetCode——Delete Duplicate Emails(巧用mysql临时表)

    Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique ...

  6. leetcode 182. Duplicate Emails having的用法 SQL执行顺序

    https://leetcode.com/problems/duplicate-emails/description/ 首先sql的执行顺序是 from-->where-->group b ...

  7. LeetCode 182. Duplicate Emails (查找重复的电子邮箱)

    题目标签: 题目给了我们一个 email 的table,让我们找到重复的 email. 可以建立 Person a, Person b, 找到两个表格中,emai 相等 但是 id 不同的 email ...

  8. [LeetCode] Duplicate Emails 重复的邮箱

    Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...

  9. LeetCode DB: Duplicate Emails

    Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...

  10. LeetCode - Duplicate Emails

    Description:Write a SQL query to find all duplicate emails in a table named Person. 找出表中重复的Email. # ...

随机推荐

  1. 最长不下降/不上升子序列&&最长上升/下降子序列

    最长不下降/不上升子序列&&最长上升/下降子序列 struct cmp1{bool operator()(int a,int b){return a>b;}}; int main ...

  2. VeryNginx故障排除

    在安装和使用 VeryNginx 的过程中可能会遇到一些问题,下面列举了常见的问题及对应的解决方案,供参考. Q: run "python instal.py install all&quo ...

  3. JSTL 的<c:if>标签没有else的解决办法

    我们可以采用<c:choose>来代替<c:if> 具体结构: <c:choose> <c:when test=""> 如果 < ...

  4. Windows XP硬盘安装Ubuntu 16.04双系统图文详解

    需要下载的东西有两个,一个是grub4dos,另一个是Ubuntu 16.04 LTS的镜像文件,具体下载地址如下:   1 2 3       1.grub4dos  点击下载 grub4dos 2 ...

  5. LDP - Linux文档工程的简介,包括帮助,向导和文档

    总览 SYNOPSIS Linux文档工程(LDP)为Linux社区提供多种自由文档资源,包括向导 (guide),常见问答 (FAQ),入门 (HOWTO) 以及手册页 (man-pages). 作 ...

  6. YUV格式详解【转】

    转自:http://blog.csdn.net/searchsun/article/details/2443867 [-] YUV格式解析1播放器project2 YUV 采样 表面定义 YUV格式解 ...

  7. JavaNIO

    Java New IO 简称 nio,在jdk1.4提供了新的api,有如下特性: 1.为所有原始类型提供缓存支持 2.字符集编解码解决方案 3.Channel:新的原始io抽象 4.支持锁和内存映射 ...

  8. Android 静态代码分析工具

    简评: 作者在文中提到的三个静态代码分析工具不是互相替代的关系,各有各的侧重点,如果有需要完全可以同时使用. 静态代码分析是指无需运行被测代码,仅通过分析或检查源程序的语法.结构.过程.接口等来检查程 ...

  9. valgrind 性能测试工具学习使用

    一.valgrind简介 Valgrind工具套件提供了许多调试和分析工具,可帮助您使程序更快,更正确.这些工具中最受欢迎的是Memcheck.它可以检测许多与C和C ++程序中常见的内存相关的错误, ...

  10. kettle批量导入json数据

    kettle新手上路,烦死了,工具好用,批量导入数据也快,就是有很多小细节需要注意. 使用kettle进行数据导入时,因为最近在做json数据的入库,以JSON Input为例进行说明: 首先是大概流 ...