title: Join 4 Tables in SQL with left join and inner join
body: <p>Hey I am trying to join 4 tables in sql, with an left join and an inner join.</p>
  
  <p>Hospital table </p>
  
  <pre><code>HospitalID| Name| Province| Email| 
  </code></pre>
  
  <p>Order table</p>
  
  <pre><code>OrderID| HospitalID| StaffID| DeliverID| Date| Time
  </code></pre>
  
  <p>Item table</p>
  
  <pre><code>ItemID| Type| Name| Quantity| Expiry_Date
  </code></pre>
  
  <p>OrderItem table</p>
  
  <pre><code>OrderItemID| OrderID| ItemID| Quantity
  </code></pre>
  
  <p>I attempted executing the following SQL query but I am getting error message and I don't know what I'm doing wrong.</p>
  
  <pre><code>SELECT Hospital.Name, Item.Type, OrderItem.Quantity
  FROM Hospital 
  LEFT JOIN [Order]   
  ON Hospital.HospitalID=[Order].HospitalID
  INNER JOIN (SELECT Item.Type 
              FROM Item 
              GROUP BY Item.Type)
  OrderItem ON Item.ItemID = OrderItem.ItemID
  ; 
  </code></pre>