Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have a Employee table with columns
ename,eid,salary,deptno. How to retrieve sum of salary for
each deptno?

Answer Posted / abhishekjaiswal

select department_id,sum(salary) Dept_wise_salary,job_id from employees group by department_id,job_id
/
Output 
DEPARTMENT_ID DEPT_WISE_SALARY JOB_ID
------------- ---------------- ----------
          110             8300 AC_ACCOUNT
           90            34000 AD_VP
           50            55700 ST_CLERK
           80           243500 SA_REP
          110            12000 AC_MGR
           50            36400 ST_MAN
           80            61000 SA_MAN
           50            64300 SH_CLERK
           20            13000 MK_MAN
           90            24000 AD_PRES
           60            28800 IT_PROG




DEPARTMENT_ID DEPT_WISE_SALARY JOB_ID
------------- ---------------- ----------
          100            12000 FI_MGR
           30            13900 PU_CLERK
          100            39600 FI_ACCOUNT
           70            10000 PR_REP
                          7000 SA_REP
           10             4400 AD_ASST
           20             6000 MK_REP
           40             6500 HR_REP
           30            11000 PU_MAN

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use %rowtype & %type in plsql?

994


Difference between truncate, delete and drop commands?

1025


how can I make a script that can be bi-language (supports english, german)? : Sql dba

945


what is the difference between delete and truncate statement in sql? : Sql dba

1130


what is rdbms? : Sql dba

961


What are the rules to be applied to nulls whilst doing comparisons?

1274


What are the triggers associated with image items?

1000


What are the two types of exceptions in pl/sql?

969


What is the execution plan in sql?

975


Explain what is a subquery ?

1124


What is the maximum rows in csv?

860


Is json a nosql?

917


What is user defined functions?

918


What are the differences between implicit and explicit cursors?

1004


What is pl sql commands?

982