sql

删除表重复记录
select *
  from tm_service_rela t1
where rowid not in
       (select min(t.rowid)
          from tm_service_rela t
         group by t.tm_package_id, t.service_code);
        
select *
  from tm_service_rela t1
where rowid >
       (select min(t.rowid)
          from tm_service_rela t
         where t1.tm_package_id = t.tm_package_id and t1.service_code = t.service_code);

你可能感兴趣的:(sql)