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

Answer Posted / vikneswaran

SELECT deptno,SUM(sal) FROM emp
GROUP BY deptno

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you select unique values in sql?

504


What are actual parameters and formal parameters?

573


What is a sql trace file?

550


How do I view a sql database?

563


Why do we use cursors?

515






What is the difference between having and a where in sql?

577


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2010


what are local and global variables and their differences? : Sql dba

542


how to use like conditions? : Sql dba

580


What is blind sql injection?

578


Can I join the same table twice?

529


how to calculate expressions with sql statements? : Sql dba

532


What is sql engine in oracle?

526


Which data type is a composite type?

534


how to convert dates to character strings? : Sql dba

539