首页 > 代码库 > left outer join

left outer join

  table   A:  
Field_K,   Field_A  
  1                       a  
  3                       b  
  4                       c  
   
  table   B:  
  Field_K,   Field_B  
  1                       x  
  2                       y  
  4                       z  
   
  select   a.Field_K,   a.Field_A,   b.Field_K,   b.Field_B  
  from   a   left  outer join   b   on   a.Field_K=b.Field_K  
   
  Field_K         Field_A         Field_K         Field_B          
  ----------   ----------   ----------   ----------    
  1                     a                     1                     x                    
  3                     b                     NULL               NULL  
  4                     c                     4                     z                    
   

left outer join