I am trying to do a SELECT query in MySQL which will also do a count in another table and join the answer into my initial table
Table people
id | name | hair_color | job_id
Table job
id | job_name
SELECT *
FROM job j
INNER JOIN (SELECT COUNT(job_id) AS totals
FROM people p
WHERE p.job_id='1')
ON j.count = totals
WHERE id = '1'
ORDER BY id ASC
So I am trying to get the above query to Select from my job table by the id and also do a count in the people table and add the column count to my job result.