SQL SERVER删除重复行

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/marko_zheng/article/details/86008645

SQL SERVER删除重复行

我的数据表中重复的字段 是 stu_id stu_name 唯一字段是id

--删除重复列
delete from stu where id not in
(select max(id) as id from stu group by stu_id) 

猜你喜欢

转载自blog.csdn.net/marko_zheng/article/details/86008645