ID NAME Email
1 John john@example.com
2 Mathew mathew@example.com
3 John jon@example.com
4 Johnson johns@example.com
5 Peter pete@example.com
如何创建将返回的查询
1 John john@example.com
3 John jon@example.com
4 Johnson johns@example.com
类似 Find rows that have the same value on a column in MySQL 的答案返回具有相同值的行。这里我需要类似的值
最佳答案
首先获取所有具有相似电子邮件的记录,然后仅打印那些符合内部条件的记录。
select * from table_name where email in (
select email from table_name
group by email
having count(*)>1
)
经过测试,工作正常。
关于mysql - SQL - 查找列中具有相似值的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39344228/