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.
Posts: 1
Joined: Tue Jun 26, 2012 6:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sub query


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.
Global moderator
Posts: 2509
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm
Has thanked: 4 times
Been thanked: 86 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,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Return to DB2


  • Related topics
    Last post