利用rowid删除重复记录?
我利用rowid删除表t中的重复记录,比如我认为a,b相同就是重复的,需要删除之后只保留一条。
一开始这样写:
delete from t where rowid not in (select rowid from (select distinct a, b from t));
结果不行。
后来写成这样:
delete from t where rowid not in (select max(rowid) from t group by a, b);
就OK了。
有没有哪位知道第一种写法为啥无效?