数据库删掉重复数据

证书库出现了重复数据,我是两个重复的删掉最小的ID

delete from gk4..Resource where refId
in
(
select MIN(refId)
from gk4..Resource where  userId in 
(
select userId
from gk4..Resource 
where loginType=0 and showResume=1
group by loginType,userId,licenceType
having COUNT(1)>1
) 
group by loginType,userId,licenceType
)



你可能感兴趣的:(数据库删掉重复数据)