zaggs — 2011-11-10T13:47:24-05:00 — #1
The following query returns the number of jobs listed in each industry. However, it will only return rows that have a count bigger than 0. Is there a way I can return all rows including rows which have 0 count?
SELECT industries . * , count( jobs.id ) AS count
LEFT JOIN jobs ON jobs.industry = industries.id
GROUP BY industries.id
ORDER BY industries.industry
Thanks in advance.
swampboogie — 2011-11-10T14:59:22-05:00 — #2
count(jobs.id) as count
on jobs.industry = industries.id
and jobs.status = 'on'
zaggs — 2011-11-10T16:28:28-05:00 — #3
Perfect, that works now - thank you for your help.