sub query



IBM's flagship relational database management system

sub query

Postby srik246 » Fri Jun 29, 2012 1:01 pm

I have two tables with names empl and dep

Empl has 4 columns

Name emp_No salary dep_no(foreign key)

Dep has three columns

Dep_no(primary key) Dep_name NO_of_emp

Now i want to retrieve sum of salary of each department grouped by depart name.
srik246
 
Posts: 1
Joined: Tue Jun 26, 2012 6:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sub query

Postby NicC » Fri Jun 29, 2012 2:56 pm

Ok - permission granted to go ahead and try a few things out.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: sub query

Postby dick scherrer » Fri Jun 29, 2012 7:40 pm

Hello and welcome to the forum,

Please do not post the same question in multiple topics. This is not acceptable. The duplicate will be deleted.

What have you coded so far? What went wrong, if anything.

We are here to help you learn, not provide "canned" solutions.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post