mysql - 查找名字/姓氏交换的重复用户
我需要查找已在表中插入两次的用户,但其名字和名称都相同。姓氏互换了。
例如,Bob Smith 在数据库中为“
firstname:Bob
lastname:Smith
&
firstname:Smith
lastname:Bob
查找这些用户的最佳查询是什么?”。
服务器运行mysql。
I need to find users that have been inserted twice in a table, but with their first name & last name swapped.
e.g. Bob Smith is in the database as
firstname:Bob
lastname:Smith
&
firstname:Smith
lastname:Bob
What's the best query to find those users?
The server runs mysql.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
基本上,对用户表进行自联接,但仅对发生 fn/ln dupe-swap 的记录进行。
Basically, do a self-join on the user table, but only on the records where the fn/ln dupe-swap occurs.