delete from pagehost where id in
(
select id from
(
select ROW_NUMBER()over (partition by webhost order by id )tt,id from pagehost
)ph where tt>1
)
删除重复网页主机记录
本文介绍了一种使用SQL语句来删除数据库中pagehost表里的重复记录的方法。通过子查询和窗口函数ROW_NUMBER(),可以有效地找出并删除那些具有相同webhost但ID不同的多余记录。
delete from pagehost where id in
(
select id from
(
select ROW_NUMBER()over (partition by webhost order by id )tt,id from pagehost
)ph where tt>1
)
2129
1154

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