LeetCode 175 Combine Two Tables mysql,left join 难度:0
2024-08-30 07:49:58
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;
最新文章
- Nhibernate mapping 文件编写
- 视觉机器学习读书笔记--------SVM方法
- ASP.net如何保证EF操作类线程内唯一
- 如何给Visual Studio 2015安装XNA4.0
- Junit4断言
- js 页面刷新方法
- javascript学习4
- Access数据导入SQLServer2008R2
- java 20 -3 递归之删除特定目录下的特定文件
- asp.net 微信企业号办公系统-流程设计--保存与发布
- Datable 排序
- js中的运算符和条件语句
- PowerCmd(转)
- js Date 日期格式化(转)
- 【原】font-awesome IE6支持代码本人测试成功
- hiho第151周 Building in Sandbox floodfill
- [UWP]为附加属性和依赖属性自定义代码段(兼容UWP和WPF)
- Navicat Premium 12激活
- python tkinter-单选、多选
- [转]Reporting Service部署之访问权限
热门文章
- python对json的操作总结
- CSS3:transform translate transition 这些都是什么?
- idea集成git
- 今日随笔:scrollTop与overflow
- HTML5正则表单式验证电子邮件
- Going from u to v or from v to u?_POJ2762强连通+并查集缩点+拓扑排序
- POJ3420Quad Tiling(矩阵快速幂)
- centos6.6安装配置jboss7.1.1
- [问题2014S15] 解答
- 利用win7系统自带的dos命令把笔记本无线网卡当无线路由器(无线AP发射器)