2 Star 10 Fork 2

CG国斌 / myleetcode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
_175.sql 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
Charies Gavin 提交于 2020-02-06 12:44 . 初始化 myleetcode 项目
-- 175. Combine Two Tables
--
-- Table: Person
--
-- +-------------+---------+
-- | Column Name | Type |
-- +-------------+---------+
-- | PersonId | int |
-- | FirstName | varchar |
-- | LastName | varchar |
-- +-------------+---------+
--
-- PersonId is the primary key column for this table.
--
-- Table: Address
--
-- +-------------+---------+
-- | Column Name | Type |
-- +-------------+---------+
-- | AddressId | int |
-- | PersonId | int |
-- | City | varchar |
-- | State | varchar |
-- +-------------+---------+
--
-- AddressId is the primary key column for this table.
--
-- Write a SQL query for a report that provides the following information for each person in the Person table, regardless if there is an address for each of those people:
--
-- FirstName, LastName, City, State
-- # Write your MySQL query statement below
SELECT Person.FirstName, Person.LastName, Address.City, Address.State
from Person LEFT JOIN Address on Person.PersonId = Address.PersonId;
Java
1
https://gitee.com/guobinhit/myleetcode.git
git@gitee.com:guobinhit/myleetcode.git
guobinhit
myleetcode
myleetcode
master

搜索帮助