I have a fairly boggling problem. What I'm after is a list of all the industries whether they have been linked to a job or not. So..
Web Design [0]
Accounts[3]
Sales[1]
Marketing[0]
So that the jobs in the database have a industry id that's saved with the job. the industry table has a list of industry types. Web Design, Accounts, Sales, Marketing etc Below is my SQL so far
SELECT ind.name,ind.id, GROUP_CONCAT(job.industry_id) AS id,
COUNT(*) AS industry_count
FROM jobs AS job,
industries AS ind
WHERE ind.id = job.industry_id
GROUP BY industry_id
This returns the count of each job that belongs to an industry but i want all industries to be returned with or without jobs linked to them. Thank you all so much for helping. Rob