Fork me on GitHub

sqlServer 重复数据项处理,只选其中一条,保留一条

select * from table where id in (select max(id) from table group by [去除重复的字段名列表,....])

--删除

from table where id not in (select max(id) from table group by [去除重复的字段名列表,....])

 

更多访问:

https://blog.csdn.net/weixin_34138139/article/details/93280536

-删除

https://blog.csdn.net/Nsy_Gamer/article/details/50790264?utm_medium=distribute.pc_relevant_download.none-task-blog-baidujs-1.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-baidujs-1.nonecase

 

posted @ 2021-03-05 14:31  HelloLLLLL  阅读(134)  评论(0编辑  收藏  举报