I have two tables, one that has assigned skills for a user, the other table has all possible skills.
I need a SQL Statement that shows unassigned skills for a user.
USER_SKILLS
user_skill_id (PK for this table)
skill_id (FK)
SKILLS
skill_id (PK for this table, FK in USER_SKILLS)
This does not seem to be working:
ALTER PROCEDURE [dbo].[SelectUserSkillsUna
ssigned]
@UserID int
AS
BEGIN
SELECT
s.name, s.description, s.skill_id
FROM
WORKFLOW..USER_SKILLS (nolock) us
JOIN
WORKFLOW..SKILLS (nolock) s ON us.skill_id <> s.skill_id
WHERE
us.user_id = @UserID
ORDER BY s.name asc
END
Start Free Trial