Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Update Question
Table Name: Emp
ename sal dnum
John Chen 1,000 15 Tom Hanks 2,000 12 Amy Hall 2,500 15 Don Fonz 3,000 12
Table Name: Dept
dnum dname tot_sal 15 Sales 12 R&D 14 Marketing
I need to Update DEPT by setting tot_sal equal to the total salary of employees in each department. If a department has no employees, tot_sal should be set to zero. (I need to use only one sql statement)
So at the end of the update dep should look like this.
dnum dname tot_sal 15 Sales 3,500 12 R&D 5,000 14 Marketing 0
Thanks
SS
‰
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Sun Nov 22 1998 - 00:00:00 CST