1.
create table tab_bak as
select id,..., from tab
where id in (
select id,count(id) from tab having count(id)>1)
)
group by id;
2. delete from tab where id in (select id from tab_bak);3.insert into tab as select * from tab_bak ;
create table tab_bak as
select id,..., from tab
where id in (
select id,count(id) from tab having count(id)>1)
)
group by id;
2. delete from tab where id in (select id from tab_bak);3.insert into tab as select * from tab_bak ;
WHERE ROWID!=(SELECT MAX(ROWID) FROM tab D WHERE tab.id=D.id);或delete from tab a
where rowid<(select max(rowid) from tab where id=a.id);
where rowid in
(
select rowid from (
select id,rowid,from tab
where id in(
select id,count(id) from tab having count(id)>1
)
group by id;
)
)