Replace Employee ID With The Unique Identifier

수이·2025년 4월 16일

🟢 코드카타 / SQL

목록 보기
82/88
post-thumbnail

Write a solution to show the unique ID of each user, If a user does not have a unique ID replace just show null.
Return the result table in any order.
문제링크

조건정리

  1. 각 사용자의 unique_id 출력
  2. 없을 경우 null 출력

풀이

  1. unique_id 가 없는 경우가 있으니까 left join 기준을 employeeuni로 잡고 join

  2. 출력값 넣어주면 끝

SELECT u.unique_id, e.name
FROM employees e 
LEFT JOIN employeeuni u ON e.id = u.id

0개의 댓글