본문 바로가기

카테고리 없음

프로그래머스 SQL <언어별 개발자 분류하기> - 비트연산, GROUP_CONCAT(추후 보충)

 

https://school.programmers.co.kr/learn/courses/30/lessons/276036

 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

 

 

 

제시된 십진수를 이진수를 기준으로 조인하라고 하길래 한참동안 이진수 변환법도 찾고, 제곱수를 구하는 방법도 찾아보다가 결국 다른 사람의 풀이를 참고해서 풀었던 문제.

요점은 비트연산과 GROUP_CONCAT이었음.

with temp as (
select case when (group_concat(name) like '%Python%') and max(category) = 'Front End' then "A"
            when group_concat(name) like '%C#%' then "B"
            when max(category) = 'Front End' then "C" end as Grade,
    id, min(email) email
from developers d join skillcodes s on d.skill_code & s.code = s.code
group by id
    )

select grade, id, email
from temp
where grade is not null
order by grade, id