Delete MatchImage
where DataId in
(select DataId FROM MatchImage group By DataId having Count(Id)>1) and Id not in (select min(Id) from MatchImage group by DataId having count(*)>1)
本文讨论了如何从数据库中删除具有重复DataId的匹配图像,并且仅保留每个DataId下的最小ID。通过使用SQL子查询进行复杂的数据过滤,实现高效的数据清理。
Delete MatchImage
where DataId in
(select DataId FROM MatchImage group By DataId having Count(Id)>1) and Id not in (select min(Id) from MatchImage group by DataId having count(*)>1)

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