zoukankan      html  css  js  c++  java
  • [LeetCode] 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 FirstName,LastName,City,State FROM Person LEFT JOIN Address ON Person.PersonId=Address.PersonId;
    # 1147 ms
  • 相关阅读:
    WMI介绍
    进程间通信
    回调函数(C/C++)
    漏洞名词介绍
    MD5 详解
    jQuery插件的写法
    node爬虫
    nodejs应用:文件上传
    node开发备注
    node生成自定义命令(yargs/commander)
  • 原文地址:https://www.cnblogs.com/immjc/p/7718916.html
Copyright © 2011-2022 走看看