My table is set up as such:
hours(INT) | job_id(INT) | emp_id (INT) | date (DATE)
What I want to do is find out which jobs employees worked on, and how many hours were spent on each job. Here's the query I've come up with:
SELECT job_id, SUM(hours), emp_id
FROM jobhours
GROUP BY job_id
ORDER BY emp_id, job_id
It's not qorking as I expect, instead, I'm getting the sum of the hours per job for all employees, not for the individual employee per job.