题目链接
https://leetcode-cn.com/problems/combine-two-tables/
题解
看LeetCode上的就行,很详细也有扩充。
AC代码
select FirstName, LastName, City, State
from Person left join Address
on Person.PersonId = Address.PersonId;
或者:(这个要慢11ms)
select FirstName, LastName, City, State
from Person as p
left join Address as a
on p.PersonId = a.PersonId;