Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Column not exists in the table

971895Nov 9 2016 — edited Nov 9 2016

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

This post has been answered by Cookiemonster76 on Nov 9 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2016
Added on Nov 9 2016
11 comments
622 views