Programming/SQL

[LeetCode] 175. Combine Two Tables

왕밤빵도라에몽 2025. 5. 5. 05:59
728x90
SELECT
    p.firstName,
    p.lastName,
    a.city,
    a.state
FROM Person AS p
LEFT JOIN Address AS a
    ON p.personId = a.personId
  • 조건을 잘 읽자 If the address of a personId is not present in the Address table, report null instead.
  • 교집합 구하는거 아니고, left join이었음
728x90