mysql - 在mysql中成对查找重复项
问题描述
我想知道如何在两列组合的表中找到重复值。
假设我的表的字段为id || name || father_name || region || dob
现在我怎样才能找到结果集,例如:
.ie 我想找到三列相同的所有行。
解决方案
select t1.*
from your_table t1
join
(
select name, father_name, region
from your_table
group by name, father_name, region
having count(*) >= 3
) t2 on t1.name = t2.name
and t1.father_name = t2.father_name
and t1.region = t2.region
推荐阅读
- python - google cloud 合成语音 501 Method not found
- docker - Docker-Machine 中的 Jenkins
- android - 变音符号渲染不正确
- git - 如何在 github 中删除提交
- matlab - Matlab:遍历矩阵行以计算最小值
- redirect - 自 VC++ 2015 / 14.0 以来,将 stderr 重定向到网络驱动程序上的文件非常慢
- android - 如何滚动通知中的文本?
- javascript - 如果使用 JavaScript/jQuery 的 FTP 上不存在该文件,有没有办法隐藏链接?
- reactjs - 将父道具异步更新到子组件
- swagger - Swagger 响应关联对象