zoukankan      html  css  js  c++  java
  • oracle中各种连接事例,left join、right join、full join

    A

      

    B

     

    --内连接 把匹配的信息全部查出来
    select * from t_wdx_a a inner join t_wdx_b b on a.id = b.id; 
    
    
    --左连接 包含左边表所有记录,右边所有的匹配的记录,如果没有则用空补齐(简写的时候+在右边)
    select * from t_wdx_a a left join t_wdx_b b on a.id = b.id;
    select * from t_wdx_a a left outer join t_wdx_b b on a.id = b.id;
    select * from t_wdx_a a,t_wdx_b b where a.id = b.id(+);
    
    --right join 右连接 包括右边表所有记录,匹配左边表的记录,如果没有则以空补齐(简写的时候+在左边)
    select * from t_wdx_a a right join t_wdx_b b on a.id = b.id;
    select * from t_wdx_a a, t_wdx_b b where a.id(+) = b.id;
    
    --full join  全连接 意思是左右表所有的记录全部显示出来
    select * from t_wdx_a a full join t_wdx_b b on a.id = b.id;
     
    
    
  • 相关阅读:
    Java 编程基础
    LING 实战
    C# 3.0\3.5 新特性
    EF Code First 入门
    C# 4.0 新特性
    JavaScript学习(二)
    JavaScript学习(一)
    csdn的blog后台程序的导航菜单的实现
    HashTable的遍历
    开通啦
  • 原文地址:https://www.cnblogs.com/yeyerl/p/7682081.html
Copyright © 2011-2022 走看看