Click to See Complete Forum and Search --> : How to multiply two columns & sum it?


muralirajan
August 11th, 1999, 07:34 AM
How to find the sum of salary departmentwise after the increment from the following table?

EmpId ** DeptId ** Salary ** %OfIncrement

001 ***** 100 ***** 20000 ***** 30
002 ***** 100 ***** 15000 ***** 25
003 ***** 200 ***** 10000 ***** 15
004 ***** 200 ***** 17500 ***** 10


I want the SQL statement which gives the following

DeptId ***** SumOfSalary

SumOfSalary is the sum of (Salary * %OfIncrement / 100) departmentwise


muralirajan

Lothar Haensler
August 11th, 1999, 07:39 AM
select sum (salary *...)/100 group by deptid

What do you think this forum is for? If you need a contract programmer, I'll be happy to send you my rates :-)