您的位置:首页 > 博客中心 > 数据库 >

Sql操作 - 删除数据库重复项

时间:2022-03-13 23:53

TableName : yourtablename

Existed Fields: yourfield1,yourfield2, handle.......


删除指定字段yourfield1为MatchedString所所有重复项


delete * from yourtablename where yourfield1='MatchedString' and handle not in (select distinct min(Handle) from chnl where yourfield1='MatchedString')



删除数据库中所有存在重复项的字段


delete * from yourtablename where handle not in (select distinct min(handle) from yourtablename group by  yourfield1)


热门排行

今日推荐

热门手游