分享

sql 专题

 醉人说梦 2021-09-14

查询重复记录

select * from idc_aqzrr where dwmc in (select dwmc from idc_aqzrr group by dwmc having count(dwmc) > 1)

=========================================

删除重复记录

delete from idc_yhsbxx where id not in (

  select a2.min_id from  (

     select min(id) as min_id from idc_yhsbxx group by dwmc)  as a2 

)

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多