sql count function
- by suryll
Hi I have three tables and I want to know how much jobs with the wage of 1000 an employee has had
The first SQL query gives me the names of all the employees that has recieved 1000 for a job
SELECT distinct first_name
FROM employee, job, link
WHERE job.wage = 1000
AND job.job_id = link.job_id and employee.employee_id = link.employee_id;
The second SQL query gives me the total number for all employees of how much jobs they have made for 1000
SELECT count(wage)
FROM employee, job, link
WHERE job.wage = 1000
AND job.job_id = link.job_id and employee.employee_id = link.employee_id;
I was wondering if there was a way of joining both queries and also making the second for each specific employee???