--查找表中多余的重复记录
select * from code_xz where code in
(select code from code_xz group by code having count(1)>1)
--删除表中多余的重复记录,只留有pk_uid最小的记录
delete from code_xz where code in
(select code from code_xz group by code having count(code) > 1)
and pk_uid not in (select min(pk_uid) from code_xz group by code having count(code)>1)