delete from tt t where exists( select 1 from (select id,count(1)c from tt group by id) where c=1 and id=t.id)
delete * from tablename t where not exists (select 1 from tablename t2 where t2.id = t.id group by t2.id having count(id) > 1);
delete from tt where (id,title,content) in(select id,title,content from (select tt.*,row_number() over(parition by id,title,content order by id) rn from tt ) where rn>1)
delete from tt where id in (select id from tt group by having count(1)=1)
掉了id delete from tt where id in (select id from tt group by id having count(1)=1)
where exists(
select 1 from (select id,count(1)c from tt group by id)
where c=1 and id=t.id)
where not exists (select 1 from tablename t2 where t2.id = t.id group by t2.id having count(id) > 1);
in(select id,title,content
from
(select tt.*,row_number() over(parition by id,title,content order by id) rn
from tt )
where rn>1)
掉了id
delete from tt where id in (select id from tt group by id having count(1)=1)