数据库内容,随机编了一些数据,其中认为两个字段name、address1一致为重复记录,保留其中一条
- 删除两个字段name、address1一致重复的记录,保留一条:
- 找出
select * from tableabc where name in( select name from tableabc group by name, address1 having count(name) > 1)
-
- 删除
1 select * from tableabc 2 where name in( select name from tableabc group by name, address1 having count(name) > 1) 3 and 4 id not in(select max(id) from [mibox].[dbo].[puzzle] group by name,address1 having count(puzzleface) > 1 )
2.