https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier

 

 

join 을 사용하여 해결한다.

Employees 테이블의 id와 EmployeeUNI 테이블의 id가 같은 row 를 기준으로 join 한다.

Employees 테이블의 name 이 무조건 포함되어야 하기에 left join 을 사용했다.

 

 

select u.unique_id, e.name
from Employees e
left join EmployeeUNI u
on e.id = u.id

 


 

< English (feedback by ChatGPT) >

 

This problem is solved using join.

(This problem can be solved using a JOIN.)

We join Employees table and EmployeeUNI table when the two table's id are the same.

(We join the Employees table with the EmployeeUNI table based on matching id values.)

 

Name columns from Employees table mucs be included, so we use left join.

(Since we must always include the name column from the Employees table, we use a LEFT JOIN.)

 

 

 

 

 

 

+ Recent posts