0

How to use sum?

I have entered an employee who have worked two times a week and many other single day now I want to calculate total salary earned by each employee in one view. The rate and hours are separately stored in table with staffid.

26th Jan 2017, 9:13 AM
Govind Pal
Govind Pal - avatar
1 Answer
+ 1
It's hard without seeing the tables... but let's make a guess: select employee_id, sum(hours), sum(hours*rate) from hours_worked group by employee_id
26th Jan 2017, 9:23 AM
Álvaro