affiliate marketing Interview Qns: UPDATE
Showing posts with label UPDATE. Show all posts
Showing posts with label UPDATE. Show all posts

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
);