首页 > 代码库 > 去重查询某表中的信息,并删除另一表中的刚刚查出来的信息

去重查询某表中的信息,并删除另一表中的刚刚查出来的信息

select DISTINCT carnum from new_op_car_owner


delete from new_op_car_owner where carnum in(
select carnum from(
  select max(carnum) as carnum,count(carnum) as count from new_op_car_owner group by carnum having count>1 order by count desc
) as tab
)

去重查询某表中的信息,并删除另一表中的刚刚查出来的信息