共计 251 个字符,预计需要花费 1 分钟才能阅读完成。
1. 查找反复的电子邮箱
本人想法(谬误)
SELECT a.Email
FROM Person a,Person b
WHERE a.Email = b.Email
后果:表内全副呈现
解决思路:计算每封邮件的存在次数
SELECT Email
FROM Person
GROUP BY Email
HAVING COUNT(Email)>1
解二:创立长期表
SELECT Email
FROM(SELECT Email,COUNT(Email) as num
FROM Person
GROUP BY Email
) tmp_table~~~~
WHERE num>1
正文完