I have 2 tables
On table "Users", each user has a number of skills. They are found on a single column and are concatenated. On table "Skills", each skill has an associated label.
It happens that some users have skills that are not referenced on table "Skills" anymore.
The select I'd like to do should list all records on table users that contain a skill that is not referenced anymore on table skills.
I was trying to do something like:
SELECT user_id
FROM USERS LEFT JOIN SKILLS
ON USERS.skills = SKILLS.skill_id
WHERE SKILLS.skill_id = null
However, the statement ON USERS.skills = SKILLS.skill_id does not fit my needs. The column USERS.skills contains the skill_id concatenated.
I tried to replace that bit by ON USERS.skills LIKE SKILLS.skill_id but it still feels wrong and the query runs forever...
Could you please enlighten me.
You can't do that in this way without programming. There are two possible ways: