SQL> select * from test; ID COLA COLB ---------- ---------- --------- 1 111111111 aaa 2 111111112 bbb 3 111111113 ccc 4 111111111 aaaSQL> delete from test a where rowid not in (select max(b.rowid) from test b where a.cola=b.cola and a.colb=b.colb);已删除 1 行。SQL> select * from test; ID COLA COLB ---------- ---------- --------- 2 111111112 bbb 3 111111113 ccc 4 111111111 aaa
说的十分正确阿,顶
---------- ---------- ---------
1 111111111 aaa
2 111111112 bbb
3 111111113 ccc
4 111111111 aaaSQL> delete from test a where rowid not in (select max(b.rowid) from test b where a.cola=b.cola and a.colb=b.colb);已删除 1 行。SQL> select * from test; ID COLA COLB
---------- ---------- ---------
2 111111112 bbb
3 111111113 ccc
4 111111111 aaa
看到这种问题,
我只会想全部取出来.. 在C#里用ArrayList.Contains来判断,发现一个重复删一个