以id重复为例
-- 查询所有
select A.*,rownumber() over (partition by id order by create_time) as cnt from schema.tabname A where dt>'2024-01-01'
-- 查询重复部分
select * from (select A.*,rownumber() over (partition by id order by create_time) as cnt from schema.tabname A where dt>'2024-01-01') where cnt>1;
-- 删除
delete from (select A.*,rownumber() over (partition by id order by create_time) as cnt from schema.tabname A where dt>'2024-01-01') where cnt>1;