DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Help with SQL

  1. #1
    Join Date
    Sep 2000
    Posts
    41

    Question

    Hi,
    I need an urgent help in SQL. Here is my problem.

    Table A :
    Eno
    SkillCode

    Table B :
    SvcCode

    Table C :
    SvcCode
    SkillCode

    Now for 1 SvcCode there can be multiple Skill Codes.

    I want to find out the list of employees (Eno) who has got all the Skills for a particular SvcCode.

    Please help me....I need an urgent solution.

    Thank you,

    Amitava

  2. #2
    Join Date
    Mar 2002
    Posts
    171
    select eno from table A where
    skillcode in(select skillcode from table C where SvcCode = &Enter_the_SvcCode);

    Hope this is the answer you were looking for.

  3. #3
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Another possible solution:

    select a.eno
    from a,c
    where c.skillcode=a.skillcode
    and c.svccode=particular_svc_code;

  4. #4
    Join Date
    Sep 2000
    Posts
    41
    Sorry but this is not the solution which I was looking for.

    These queries will give me the employees who has got even some of the skills required for a particular service.

    But I need only those employees who has got ALL the skills for a particular service.

    relationship between Table A and C is many to many
    Between Table B and C is one to many.

  5. #5
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    select a.eno,c.skillcode from tablea a,tablec c where
    a.skillcode=c.sillcode and c.svccode=&svccode;
    anandkl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width