Leetcode-PHP题解D91-175-Combine-Two-Tables

D91 175. Combine Two Tables

题目链接

175. Combine Two Tables

题目分析

这个题目比较简单,就是简单的连表查询。

思路

以person表为出发点,于address表join。join依据是personId。

最终代码

# Write your MySQL query statement below
SELECT person.FirstName, person.LastName, address.City, address.State FROM person LEFT JOIN address ON address.personId = person.personId

若觉得本文章对你有用,欢迎用爱发电资助。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理