美文网首页
175. Combine Two Tables

175. Combine Two Tables

作者: wenmingxing | 来源:发表于2018-07-16 11:18 被阅读50次
    题目链接:

    175. Combine Two Tables

    解析:

    本题直接考查表的联结,由于题目要求regardless if there is an address for each of those people,所以我们应该使用LEFT JOIN ... ON结构,关于表的联结内容,可以参考:

    MySQL之联结表 JOIN

    题解:
    # 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;
    

    相关文章

      网友评论

          本文标题:175. Combine Two Tables

          本文链接:https://www.haomeiwen.com/subject/uvwvpftx.html