删除重复的SQL记录 [英] Delete Duplicate SQL Records
本文介绍了删除重复的SQL记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在表中删除具有重复名称的记录的最简单方法是什么?我遇到的答案很混乱。
相关:
解决方案
我知道了!
删除
t1
从
tTable t1,tTable t2
其中
t1.locationName = t2.locationName和
t1.id> t2.id
http://www.cryer.co.uk/brian/sql/sql_delete_duplicates.htm
What is the simplest way to delete records with duplicate name in a table? The answers I came across are very confusing.
Related:
解决方案
I got it! Simple and it worked great.
delete
t1
from
tTable t1, tTable t2
where
t1.locationName = t2.locationName and
t1.id > t2.id
http://www.cryer.co.uk/brian/sql/sql_delete_duplicates.htm
这篇关于删除重复的SQL记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文