Hi,
I'm inexperienced with SQL... i'm trying to figure out how to search my database for personnel with specific skills.
I want to generate a table which contains two columns, Name and Skill(s)
The initial search is currently performing this query:
SELECT *
FROM User_Skills LEFT JOIN
skills ON User_Skills.Skill_id = Skills.id
WHERE Skill_id = 5 OR Skill_id = 7 // 5 & 7 are variables.
This generates results like this:
User_id Skill_id id name
1000 5 5 Designer
1000 7 7 Data Analysis
1001 7 7 Data Analysis
1001 5 5 Designer
The question is... am I doing this right? I'm searching for specific skills.. once I find the skills, should I then use the User_id's to perform a second query? I dont know if I need the name returned twice, as it would if I joined the Users table to the above query. Or should I JOIN the User table, then cull data I don't need programatically.