我创建了两个表,T1和T2,每个表分别有一列,abc和xyz.我在每个表中插入了2行(数值1和2).
当我运行命令“从t2选择abc”时,它会抛出一个错误,表示表T2中不存在列abc.但是,当我运行命令“从t1删除abc in(SELECT abc from t2);”时,删除2行.
create table t1 (abc number); –Table created
create table t2 (xyz number); –Table created
insert into t1 values (1); –One row inserted
insert into t1 values (2); –One row inserted
insert into t2 values (1); –One row inserted
insert into t2 values (2); –One row inserted
SELECT abc from t2; –ORA-00904 -> Because column abc does not exist in t2
delete from t1 where abc in (SELECT abc from t2); –2 rows deleted