zoukankan      html  css  js  c++  java
  • 数据库

    目的:  两张表中数据联系起来查询符合条件的数据(笛卡尔积)

    实现:SQL语句

    (1)内连接:join xxx on xxx
        1 等值连接
            select 
                  xxx 
            from  
                table1 
            (inner:表示内连接,可省略)join 
                table2 
            on
                xxx=xxx (链接条件)
            where(数据过滤)
                xxx=xxx ;
        2 非等值链接
            select 
                  xxx 
            from  
                table1 
            (inner:表示内连接,可省略)join 
                table2 
            on
                (链接条件)变为:xxx between xxx and xxx
            where(数据过滤)
                xxx=xxx ;
        3 自链接
    2)外连接:
        特点:一条一条匹配链接时,自动填充null匹配链接的表中没有的数据;与内连接相比查询记录条数多;
       1 左外链接
    将join左边的表中的数据全部找出来
    select .. from ... left (outer:可省略) join ... on ... where ...
    2 右外链接
    将join左边的表中的数据全部找出来
    select .. from ... right (outer) join ... on ... where ...
  • 相关阅读:
    leetcode -- Add Binary
    leetcode -- 4sum
    leecode -- 3sum Closet
    C++单例模式
    MapReduce的模式、算法和用例
    react 学习笔记
    css3 文字过长用...代替
    scss/css 中添加ie hack
    springmvc 解决跨域CORS
    springmvc 添加Junit4
  • 原文地址:https://www.cnblogs.com/floakss/p/12769916.html
Copyright © 2011-2022 走看看