my goal is to list each job_title or job_id and under each job_title or job_id I want to list the candidates that qualify for that job
I have this sql query:
SELECT *
FROM rank_results AS result
WHERE result.job_id='{$job_id}'
GROUP BY job_id
ORDER BY rank ASC
I know this is a partial query, but I do not know how or where to do the subquery. I have tried:
SELECT *
FROM rank_results AS result
WHERE result.job_id=( SELECT advert_id from job_advert WHERE advert_id = '{$job_id}' AND (SELECT firstname,id_number FROM applicant_details where id_number = applicant_id)
GROUP BY job_id
ORDER BY rank ASC
with no luck... I have looked at Hierarchical Data in MySQL, and I think that is what I need to do. I do not kno how to accoplish this thought. any help would be appreciated