DELETE FROM apma_archive_config_manage WHERE id in (
SELECT * FROM (
select b.id from apma_archive_config_manage b, (
SELECT max(id) max_id, module_id, storage_locate, typedef, tenant_id FROM apma_archive_config_manage GROUP BY module_id, storage_locate, typedef,tenant_id HAVING COUNT(*) > 1
) a where b.module_id=a.module_id and b.storage_locate=a.storage_locate and b.typedef=a.typedef and b.tenant_id=a.tenant_id
and b.id <> a.max_id) tmp )
删除重复配置
显示
添加了评论 - DELETE FROM apma_archive_config_manage WHERE id in (
SELECT * FROM (
select b.id from apma_archive_config_manage b, (
SELECT max(id) max_id, module_id, storage_locate, typedef, tenant_id FROM apma_archive_config_manage GROUP BY module_id, storage_locate, typedef,tenant_id HAVING COUNT(*) > 1
) a where b.module_id=a.module_id and b.storage_locate=a.storage_locate and b.typedef=a.typedef and b.tenant_id=a.tenant_id
and b.id <> a.max_id) tmp )
删除重复配置
SELECT * FROM (
select b.id from apma_archive_config_manage b, (
SELECT max(id) max_id, module_id, storage_locate, typedef, tenant_id FROM apma_archive_config_manage GROUP BY module_id, storage_locate, typedef,tenant_id HAVING COUNT(*) > 1
) a where b.module_id=a.module_id and b.storage_locate=a.storage_locate and b.typedef=a.typedef and b.tenant_id=a.tenant_id
and b.id <> a.max_id) tmp )
删除重复配置