I need to create a select query with count from another table.
I have two tables like category and candidates. Every candidate belong to one category.
Here I want to select all categories from category table along with how many candidates available for each category.
like this: category_name(23)
This is how I tried it. but it doesn't work for me.
SELECT c.category_id
, c.name
, COUNT(cn.job_category) AS cvs
FROM job_category c
LEFT JOIN candidates cn ON cn.job_category = c.category_id
ORDER BY c.name ASC