문제
나의 해답
select distinct d.ID, d.EMAIL, d.FIRST_NAME, d.LAST_NAME
from DEVELOPERS as d join SKILLCODES as s
where (s.name ='Python' or s.name = 'C#') and (d.skill_code & s.code) = s.code
order by d.id asc
해설
- DEVELOPERS as d join SKILLCODES as s : DEVELOPERS 테이블과 SKILLCODES 테이블을 조인
- where (s.name ='Python' or s.name = 'C#') : 스킬 코드 이름이 ‘Python’ 또는 ‘C#’인 경우
- (d.skill_code & s.code) = s.code : 개발자의 스킬 코드와 SKILLCODES 테이블의 코드 간에 비트 AND 연산을 수행하여 일치하는 경우만
- order by d.id asc : 개발자를 ID를 기준으로 오름차순
Share article