zoukankan      html  css  js  c++  java
  • SQL语句左连接与右连接和内连接简单示例

    left  outer  join  
    Right  Outer  Join  
     
    ---------------------------------------------------------------  
     
    把下面的语句运行一把就知道了  
     
    drop  table  test_a  
    go  
    drop  table  test_b  
    go  
    create  table  test_a  (a  int,  b  int)  
    go  
    create  table  test_b  (a  int,  b  int)  
    go  
    insert  test_a  values  (1,1)  
    insert  test_a  values  (2,1)  
    insert  test_a  values  (3,1)  
    go  
    insert  test_b  values  (4,1)  
    insert  test_b  values  (2,1)  
    insert  test_b  values  (3,1)  
    go  
    select  test_a.*  ,test_b.*  from  test_a  left  join  test_b  on  test_a.a=test_b.a

      
    select  test_a.*  ,test_b.*  from  test_a  right  join  test_b  on  test_a.a=test_b.a

     
    select  test_a.*  ,test_b.*  from  test_a  inner  join  test_b  on  test_a.a=test_b.a  


    select  test_a.*  ,test_b.*  from  test_a  full  join  test_b  on  test_a.a=test_b.a  

  • 相关阅读:
    python
    图片放大,缩小等操作
    template-web.js 自定义过滤器
    python
    python
    Android Volley源码分析及扩展
    Android 6.0动态权限申请教程
    Jarsigner签名使用
    Python正则表达式(总)
    Python错误和异常概念(总)
  • 原文地址:https://www.cnblogs.com/EDSON/p/2469331.html
Copyright © 2011-2022 走看看