홍동이의 성장일기

[LeetCode] 175. Combine Two Tables 본문

Tool/SQL 코딩테스트 풀이

[LeetCode] 175. Combine Two Tables

홍동2 2023. 4. 17. 15:22

 

 

Combine Two Tables - LeetCode

Can you solve this real interview question? Combine Two Tables - Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | personId | int | | lastName | varchar | | firstName | varchar | +-------------+---------+ personId i

leetcode.com

 

select p.firstname, p.lastname, a.city, a.state
from person p left join address a
on p.personId = a.personId;

 

 

💡 개념정리

 

LEFT JOIN 

on으로 동일한 컬럼 연결해주기

728x90
Comments