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

Answer Posted / sudarsan

SELECT
DeptNo AS Department,
Count(DeptNo) AS Dept_Count,
Sum(Salary) AS Salary_DeptWise FROM Employee
GROUP BY DeptNo

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to sort a column using a column alias?

609


What do you mean by rowid?

541


What is trigger price?

545


What does select * from mean in sql?

2002


What programs use sql?

529






Is sql the best database?

503


what is a database transaction? : Sql dba

587


How do I pipe the output of one isql to another?

535


How we can update the view?

605


What are pl/sql cursor exceptions?

580


what is a trigger in mysql? : Sql dba

607


How bulk collect improves performance?

574


How can you tell the difference between an index and a view?

496


Why do we use partitions in sql?

549


Is it possible to create the following trigger: before or after update trigger for each row?

723