I have two tables . Details Below:
desc test
Name Null? Type
----------------------------------------- -------- ----------------------------
AA VARCHAR2(10)
BB VARCHAR2(10)
desc test1
Name Null? Type
----------------------------------------- -------- ----------------------------
CC VARCHAR2(10)
DD VARCHAR2(10)
select * from test;
AA BB
---------- ----------
aa1 bb1
aa2 bb2
aa3 bb3
aa4 bb4
select * from test1;
CC DD
---------- ----------
cc1 dd1
What I Observed
==================
When i try to query from TEST table using a SUBQUERY output from TEST1 without an non exisitng coulum in TEST2 it gives me output. However it should throws me error.
-----------AA column no exisitng in TEST1
select * from TEST where AA in (select AA from TEST1);
AA BB
---------- ----------
aa1 bb1
aa2 bb2
aa3 bb3
aa4 bb4
-----------BB column no exisitng in TEST1
select * from TEST where BB in (select BB from TEST1);
AA BB
---------- ----------
aa1 bb1
aa2 bb2
aa3 bb3
-----------This is expected.
select * from TEST
where AA in (select AAA from TEST1);
where AA in (select AAA from TEST1)
*
ERROR at line 2:
ORA-00904: "AAA": invalid identifier
Can anyone let me know what is the issue here. Let me know more clarification needed.
Thanks
KY