mk wrote:
Hi all,
I have a dept table with following structure like
Column
-------------
DEPTNO
SAL
I want to get to maximum renumeration paid to each department......
max(sum(sal)) is not working....
Any ideas regading....
Adv thanks Reg
You want the department with the biggest salary expense?
The easiest I can think of is:
SELECT dept, SUM(salary) FROM emp
GROUP BY dept
ORDER BY 2 DESC FETCH FIRST ROW ONLY
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/