Please help me identify what I am doing wrong in the query below :
The following code gives an error: ORA-00904 : DPT.DEPTNO : invalid identifier
UPDATE emp1
SET ename = (SELECT dname
FROM dpt
WHERE dpt.deptno = emp1.deptno)
WHERE EXISTS (SELECT ename
FROM emp1
WHERE emp1.deptno = dpt.deptno);
the first half of the query works fine on its own :
UPDATE emp1
SET ename = (SELECT dname
FROM dpt
WHERE dpt.deptno = emp1.deptno)
and I am just practicing my concepts so trying to turn things around without having to make new tables. – Manushree Mishra Sep 27 '15 at 17:13