It says subquery returns more than 1 row but I'm not sure why?

I've joined around 4 tables in my database and I am trying to get a shortlist of candidates who meet these requirements. It won't display another person who meets these requirements. It for some reason works when there is one candidate that meets them.

SELECT job_seeker.seeker_fn
    ,job_seeker.seeker_ln
    ,COUNT(DISTINCT job_seeker.position_title) AS 'Required Skills'
    ,COUNT(DISTINCT quali_name) AS 'Required Qualifications'
FROM job_seeker
INNER JOIN job_seeker_profile ON job_seeker.seeker_ID = job_seeker_profile.seeker_ID
INNER JOIN qualifications ON job_seeker_profile.qualification_ID = qualifications.qualification_ID
INNER JOIN skill_types ON job_seeker_profile.skill_type_ID = skill_types.skill_type_ID
INNER JOIN skill_areas ON skill_areas.area_ID = skill_areas.area_ID
INNER JOIN job_pos ON qualifications.qualification_ID = job_pos.qualification_ID
WHERE (
        SELECT job_pos.qualification_ID
        FROM job_pos
        WHERE job_pos.qualification_ID = job_seeker_profile.skill_type_ID
            AND job_pos.qualification_ID = job_seeker_profile.qualification_ID
        )
    AND job_pos.job_position_ID = 7;

enter image description here



from Recent Questions - Stack Overflow https://ift.tt/36fd8KT
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations