1、先按重复记录fk分组找最小的记录,然后更新id 不在子查询中的数据
update td_f_stop_history set del_flag='1' where "id" not in
(select "min"("id") from td_f_stop_history where allowed_recover='1' and del_flag='0'
group by fk HAVING "count"(fk)>1)
and allowed_recover='1' and del_flag='0';