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.

Code

SELECT Email from Person GROUP BY Email HAVING count(Email) > 1

[LeetCode] 182. Duplicate Emails_Easy tag: SQL的更多相关文章

  1. [LeetCode] 196. Delete Duplicate Emails_Easy tag: SQL

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

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

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

  3. Leetcode 182. Duplicate Emails

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

  4. [LeetCode] 197. Rising Temperature_Easy tag: SQL

    Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to ...

  5. [LeetCode] 595. Big Countries_Easy tag: SQL

    There is a table World +-----------------+------------+------------+--------------+---------------+ ...

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

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

  7. [LeetCode] 610. Triangle Judgement_Easy tag: SQL

    A pupil Tim gets homework to identify whether three line segments could possibly form a triangle. Ho ...

  8. [LeetCode] 607. Sales Person_Easy tag: SQL

    Description Given three tables: salesperson, company, orders.Output all the names in the table sales ...

  9. [LeetCode] 577. Employee Bonus_Easy tag: SQL

    Select all employee's name and bonus whose bonus is < 1000. Table:Employee +-------+--------+---- ...

随机推荐

  1. 【云迁移论文笔记】Cloud Migration Research:A Systematic Review

    Cloud Migration Research:A Systematic Review Author Info: Pooyan Jamshidi PhD Postdoctoral Researche ...

  2. java基础---->java的新特性(一)

    通过简单的实例来感觉一下java7和java8的新特性.当那条唯捷径省略了朝拜者,我便在一滴花露中瞬间彻悟. java7代码实例 一.java7中switch中可以字符串 @Test public v ...

  3. 云计算设计模式(六)——命令和查询职责分离(CQRS)模式

    云计算设计模式(六)——命令和查询职责分离(CQRS)模式 隔离,通过使用不同的接口,从操作读取数据更新数据的操作.这种模式可以最大限度地提高性能,可扩展性和安全性;支持系统在通过较高的灵活性,时间的 ...

  4. 【Spring Boot&& Spring Cloud系列】单点登录SSO概述

    概念 单点登录(Singleton Sign On),简称为SSO,是目前比较流行的企业业务整合的解决方案之一.SSO的定义是在多个应用系统中,用户只需要登录一次就能访问所有相互信任的应用系统. 也就 ...

  5. 【大数据系列】HDFS初识

    一.HDFS介绍 HDFS为了做到可靠性(reliability)创建了多分数据块(data blocks)的复制(replicas),并将它们放置在服务集群的计算节点中(compute nodes) ...

  6. Word 2013无法启用Restrict Editing解决方法

    当前文档可能是Mail Merge Letter type document,MAILINGS -> Start Mail Merge -> Normal Word Document保存即 ...

  7. OpenMax概述

    一.OpenMax简介 OpenMAX是一个多媒体应用程序的标准.由NVIDIA公司和Khronos™在2006年推出. 它是无授权费的.跨平台的C语言程序接口序列,这些接口对音频.视频.静态图片的常 ...

  8. SOA面向服务的架构

    1.关于SOA的定义,目前主要有以下三个: 1)W3C的定义:SOA是一种应用程序架构,在这种架构中,所有功能都定义为独立的服务,这些服务带有定义明确的可调用接口,能够以定义好的顺序调用这些服务来形成 ...

  9. 在linux上执行.net Console apps

    有个程序,在.net下写了半天,总算跑起来了,发现有个问题,在windows上不好弄,而同事前一段时间已经有Linux下的解决方法了,于是想直接将.net程序放在linux下运行 在linux上的mo ...

  10. 【CF932E】Team Work/【BZOJ5093】图的价值 数学+NTT

    [CF932E]Team Work 题意:求$\sum\limits_{i=1}^nC_n^ii^k$,答案模$10^9+7$.$n\le 10^9,k\le 5000$. [BZOJ5093]图的价 ...