Advertisement

07.03.2008 at 08:27AM PDT, ID: 23537185
[x]
Attachment Details

JOIN to show what is not assigned yet

Asked by knowlton in MS SQL Server

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].[SelectUserSkillsUnassigned]
      @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
 
Loading Advertisement...
 
[+][-]07.03.2008 at 08:35AM PDT, ID: 21926490

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.03.2008 at 08:36AM PDT, ID: 21926499

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.03.2008 at 08:36AM PDT, ID: 21926503

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.03.2008 at 08:38AM PDT, ID: 21926514

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Sign Up Now!
Solution Provided By: jcoehoorn
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.03.2008 at 02:58PM PDT, ID: 21929609

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906