Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Update Question

Update Question

From: <shirushah_at_hotmail.com>
Date: Sun, 22 Nov 1998 02:58:59 GMT
Message-ID: <737ulf$skt$1@nnrp1.dejanews.com>


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
&#137;

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Sat Nov 21 1998 - 20:58:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US