查询数据库表里重复的数据
SELECT 字段A, 字段B, 字段C, COUNT(*) FROM Table GROUP BY 字段A, 字段B, 字段C HAVING COUNT(*) > 1;
查找表中多余的重复记录(多个字段),不包含rowid最小的记录
select * from pls_ad_profile a
where (a.seller_account,a.profile_id) in (select seller_account,profile_id from pls_ad_profile group by seller_account,profile_id having count(*) > 1)
and id not in (select min(id) from pls_ad_profile group by seller_account,profile_id having count(*)>1);
SQL重复数据查询技巧
本文详细介绍了如何使用SQL语句查询数据库表中的重复数据,包括单一字段和多个字段的重复情况,并提供了排除rowid最小记录的高级查询方法。
667

被折叠的 条评论
为什么被折叠?



