title: Odd Outer Joining Structure for a View
body: <p>I am importing a view from an old database as part of a software upgrade and I saw this <code>FROM</code> clause as I was working. </p>
  
  <pre><code>FROM 
      t_store_master AS STM 
  RIGHT OUTER JOIN 
      dbo.t_shipping AS SHP 
  INNER JOIN 
      t_hu_master AS HUM 
  INNER JOIN 
      t_stored_item AS STO ON HUM.hu_id = STO.hu_id
        ON SHP.shipment_id = HUM.reserved_for 
        AND SHP.location_id = HUM.location_id 
  INNER JOIN 
      dbo.t_carrier AS CAR ON SHP.carrier_code = CAR.carrier_code 
  LEFT OUTER JOIN 
      dbo.t_order_detail AS ORD 
  INNER JOIN 
      dbo.t_order AS ORM ON ORD.order_number = ORM.order_number
  INNER JOIN 
      dbo.t_pick_detail PDL ON ORD.order_number = PDL.order_number
         ON STO.type = PDL.pick_id
         ON STM.store_id = HUM.control_number_2
  </code></pre>
  
  <p>It is my understanding that <code>OUTER JOIN</code> requires an <code>ON</code> clause in order to be interpreted properly by the compiler. However, there must be some edge case scenarios I am unaware of because the code above returns good data without throwing any errors. </p>
  
  <p>After some goggling and reading up on MSDN standards for <code>OUTER JOIN</code>s, I am still at a loss for what the <code>LEFT OUTER JOIN</code> and <code>RIGHT OUTER JOIN</code> are doing in this query. </p>
  
  <p>I do know that the multiple <code>ON</code> clauses beneath the <code>INNER JOIN</code>s are necessary. There seems to be some kind of hidden or implied mapping being done between the <code>ON</code> clauses and the <code>OUTER JOIN</code>s. Past that I cannot tell what the purpose of writing a query this way would be. </p>
  
  <p>Could someone shed some insight on how this works and why it would be written this way? </p>