mysql数据库,删除重复文章,保留一篇文章
时间:4年前 阅读:7644 评论:2
delete from Person where Id not in ( select t.min_id from ( select min(Id) as min_id from Person group by Title ) as t );
id是主键,Person是表名,Title是要删除重复的字段,亲测可以使用,非常nice!
版权声明:本文为期权记的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://www.qiquanji.com/post/47702.html
微信扫码关注
更新实时通知
网友评论
admin
回复UPDATE `zbp_post` SET `log_Content` = REPLACE(`log_Content`, 'FX.com', 'qiquanji.com') WHERE `log_Content` LIKE '%FX.com%' AND `log_CateID`=21
admin
回复delete from zbp_post where log_ID not in ( select t.min_id from ( select min(log_ID) as min_id from zbp_post group by log_Title ) as t) and log_CateID=21