Leetcode 175 Combine Two Tables
2015-06-30 13:29
447 查看
Table:
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:
左联基本操作
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
左联基本操作
select FirstName, LastName, City, State from Person left join Address on Person.PersonId = Address.PersonId
相关文章推荐
- 相关文章收藏
- 插入排序 C实现
- E2 驾驭const
- c++函数指针和多态的关系,与Java的联系
- 深入剖析Android音频之AudioTrack
- Linux上free命令
- ACdreamoj(1105)模拟题
- Problem 1170 - Sorting
- 约瑟夫环 PHP实现
- 新GRE句子填空题改变及应对策略
- C++运算符&和&&|和||的不同点
- First choice to buy swtor max credits with news about SWTOR Exploit
- Android AudioTrack分析
- 05 基本元素 常量
- 本地删除无效的远程分支
- HDU 3015 Disharmony Trees 【 树状数组 】
- SAT数学常见考点解析之概率
- Objective-C程序设计第10章---More on Variable and Data Types
- linux设置tomcat开机自动启动
- 介绍GRE填空技巧之词项释义法