drop TABLE EMP;
drop TABLE dept;
CREATE TABLE EMP
(
EMPNO NUMBER,
ENAME VARCHAR2(10 BYTE),
DEPTNO NUMBER
);
Insert into EMP(EMPNO, ENAME, DEPTNO)
Values (7499, 'smith', 10);
Insert into EMP (EMPNO, ENAME, DEPTNO)
Values (7599, 'smith', 20);
COMMIT;
select * from emp where deptno in (select deptno from dept)
if run the above query ,getting the result. as per my understading "deptno" column not exists in dept table it should raise the error.
if we run outside it is raising the error -> (select deptno from dept
ORA-00904: "DEPTNO": invalid identifier
Could please help me why subquery not raising the error.
Thanks,
Murali