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  

  • 相关阅读:
    redis 内部数据结构 quicklist
    redis 七种内部数据结构
    魔漫相机
    情绪识别API
    AdressBook通讯录
    单例
    UI控件---UINavigationController导航栏控制器
    UI控件之UIScrollView
    UIScrollViewDelegate协议方法概述
    代理设计模式---传值
  • 原文地址:https://www.cnblogs.com/EDSON/p/2469331.html
Copyright © 2011-2022 走看看