affiliate marketing Interview Qns: Can I Update From Another Table ?

Monday, October 25, 2010

Can I Update From Another Table ?

Yes. For example, if we had a table DEPT_SUMMARY, we could update the number of employees field as follows:
update DEPT_SUMMARY s
set NUM_EMPS = (
select count(1)
from EMP E
where E.DEPTNO = S.DEPTNO
);

No comments:

Post a Comment