欢迎投稿

今日深度:

题目7:MySQL----------Duplicate Emails,email

题目7:MySQL----------Duplicate Emails,email


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 |
+---------+
题目解答:

# Write your MySQL query statement below
SELECT DISTINCT a.Email
FROM Person a JOIN Person b
ON (a.Email = b.Email)
WHERE a.Id <> b.Id








www.htsjk.Com true http://www.htsjk.com/shujukunews/8328.html NewsArticle 题目7:MySQL----------Duplicate Emails,email 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...
评论暂时关闭