zoukankan      html  css  js  c++  java
  • 外连接与内连接

    1.左外连接
    select * from t_a a left join t_b b on a.id=b.id;
    select * from t_a a,t_b b where a.id=b.id(+);

    2.右外连接
    select * from t_a a right join t_b b on a.id = b.id;
    select * from t_a a,t_b b where a.id(+)=b.id;

    3.完全外连接
    select * from t_a a full join t_b b on a.id=b.id;

    4.等值连接(我们在看看等值连接的结果)
    select * from t_a a,t_b b where a.id=b.id;
    select * from t_a a join t_b b on a.id=b.id;--等值连接也可以这样写

    注意:以前理解等值连接和完全外连接是一回事,现在看来是我理解错了。等值连接是只把满足条件的两个表的行相连,然后显示出来。完全外连接是把匹配查询条件的行、左表没有匹配到的、右表没有匹配到的都显示出来。

  • 相关阅读:
    位运算
    方法重载
    基本数据类型与引用数据类型参数
    带返回值方法的定义格式
    return使用
    方法的通用格式
    方法定义的格式
    google chrome developer tools
    Skolelinux
    ajax
  • 原文地址:https://www.cnblogs.com/sjxbg/p/10482806.html
Copyright © 2011-2022 走看看