delete from 表 where id not in (select max(id) from 表 WHERE 字段名='xxx' group by contract_guid) AND 字段名='xxx'
根据条件删除分组后最大数据外以外的其他数据
最新推荐文章于 2022-09-21 17:46:39 发布
delete from 表 where id not in (select max(id) from 表 WHERE 字段名='xxx' group by contract_guid) AND 字段名='xxx'