https://leetcode.com/problems/combine-two-tables/

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
select p.FirstName,p.LastName,a.City,a.State from Person as p left join Address as a on p.PersonId = a.PersonId;

  

最新文章

  1. Nhibernate mapping 文件编写
  2. 视觉机器学习读书笔记--------SVM方法
  3. ASP.net如何保证EF操作类线程内唯一
  4. 如何给Visual Studio 2015安装XNA4.0
  5. Junit4断言
  6. js 页面刷新方法
  7. javascript学习4
  8. Access数据导入SQLServer2008R2
  9. java 20 -3 递归之删除特定目录下的特定文件
  10. asp.net 微信企业号办公系统-流程设计--保存与发布
  11. Datable 排序
  12. js中的运算符和条件语句
  13. PowerCmd(转)
  14. js Date 日期格式化(转)
  15. 【原】font-awesome IE6支持代码本人测试成功
  16. hiho第151周 Building in Sandbox floodfill
  17. [UWP]为附加属性和依赖属性自定义代码段(兼容UWP和WPF)
  18. Navicat Premium 12激活
  19. python tkinter-单选、多选
  20. [转]Reporting Service部署之访问权限

热门文章

  1. python对json的操作总结
  2. CSS3:transform translate transition 这些都是什么?
  3. idea集成git
  4. 今日随笔:scrollTop与overflow
  5. HTML5正则表单式验证电子邮件
  6. Going from u to v or from v to u?_POJ2762强连通+并查集缩点+拓扑排序
  7. POJ3420Quad Tiling(矩阵快速幂)
  8. centos6.6安装配置jboss7.1.1
  9. [问题2014S15] 解答
  10. 利用win7系统自带的dos命令把笔记本无线网卡当无线路由器(无线AP发射器)