设为首页 加入收藏

TOP

题目7:MySQL----------DuplicateEmails
2015-07-24 12:16:33 来源: 作者: 【 】 浏览:72
Tags:题目 MySQL----------DuplicateEmails

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


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇impdp遭遇ORA-39029、ORA-31671、.. 下一篇备份和恢复

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: