Friday, February 25, 2011

Left/Right Outer Joins

Below are examples of left and right outer joins.

 use Yummys
  
 select *
  
 from Brand B
  
 left outer join xrefFlavorBrand xrefFB
  
 on B.BrandID = xrefFB.BrandID
  
 --Right Outer Join
  
 select *
  
 from sales S
  
 right outer join xrefDistSales xrefDS
  
 on S.SalesID = xrefDS.SalesID  

No comments:

Post a Comment