oracle:查重,并且根据条件去掉一个重复的数据

查重:

 select no from table_name group by no having count(no)>1;
 
删除重复数据中id较大的数据:
delete  from  table_name 
where no in (select no from table_name group by no having count(no)>1)  and id  not in (select min(id) from table_name group by no  having count(no)>1)

posted @ 2020-11-11 14:51  半夏、、、微凉  阅读(448)  评论(0)    收藏  举报