LeetCode 175. Combine Two Tables (组合两个表)

题目标签:

  题目给了我们两个table,让我们合并,根据Person为主。

  因为题目说了 提供person 信息,不管这个人有没有地址。所以这里用Left Join。

Java Solution:

Runtime:  244 ms, faster than 40 % 

完成日期:05/22/2019

关键点:Left Join

# Write your MySQL query statement below
Select FirstName, LastName, City, State
From Person Left Join Address 
              On Person.PersonId = Address.PersonId;

参考资料:LeetCode Solution

LeetCode 题目列表 - LeetCode Questions List

题目来源:https://leetcode.com/

猜你喜欢

转载自www.cnblogs.com/jimmycheng/p/11397734.html