我想把t1中a列重复的删掉,于是我建立了表t2,create table t2 as select distinct(a) from t1
SQL> select * from t1
2 /
A B C D
---------- ---------- ---------- ----------
1 2 3 2
2 3 2 1
1 2 2 2
SQL> select * from t2
2 /
A
----------
1
2
SQL> delete from t1 where rowid=(select max(rowid) from t1 where t1.a=t2.a)
2 /
delete from t1 where rowid=(select max(rowid) from t1 where t1.a=t2.a)
*
ERROR 位于第 1 行:
ORA-00904: "T2"."A": 无效的标识符
我怎么才能把t1中a列重复的列删掉呢
SQL> select * from t1
2 /
A B C D
---------- ---------- ---------- ----------
1 2 3 2
2 3 2 1
1 2 2 2
SQL> select * from t2
2 /
A
----------
1
2
SQL> delete from t1 where rowid=(select max(rowid) from t1 where t1.a=t2.a)
2 /
delete from t1 where rowid=(select max(rowid) from t1 where t1.a=t2.a)
*
ERROR 位于第 1 行:
ORA-00904: "T2"."A": 无效的标识符
我怎么才能把t1中a列重复的列删掉呢
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8135069/viewspace-136060/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8135069/viewspace-136060/