I have 2 tables Employee and Skills
with following fields:
Employee:Id,Name,Location
Skills:Id,Skills
Employee data:
Id Name Location
7 Abc London
8 Xyz London
9 Xyz USA
10 Abc USA
Skills:
Id skills EmployeeId
12 AAA Xyz 7
13 BBB 7
14 CCC 7
15 AAA 8
16 BBB 8
17 CCC 8
18 AAA 9
19 BBB 9
20 CCC 9
21 AAA 10
22 BBB 10
20 CCC 10
Now I want to get skills of those employee whose Name is Abc
,Location is London and Skills is both AAA and BBB
only but I want single output like below:
Skills
10,11
This is my query:
select S.Id from Employee E inner join
Skills S on E.Id=s.EmployeeId
where (E.Name='Abc' and E.Location='London'
and s.skills='AAA') and (E.Name='Abc' and E.Location='London'
and s.skills='BBB')
But I am getting wrong output.