假设该表名为ABC
delete from ABC a where a.rowid!=(select max(rowid) from ABC b where a.a=b.a and a.b=b.b and a.c=b.c);
我已在数据库上试过!
delete from ABC a where a.rowid!=(select max(rowid) from ABC b where a.a=b.a and a.b=b.b and a.c=b.c);
我已在数据库上试过!
select max(rowid) from tbname group by a,b);
where rowid>(select min(rowid) from tab B where A.a=B.a and A.b=B.b)
和
delete from tbname where rowid not in(
select max(rowid) from tbname group by a,b)
任何一种方法都可以实现,两种方法没有什么本质的区别
delete from ABC
insert into ABC
select * from #t
drop table #t