title: Query Results across 3 tables
body: <p>I have a need to see a client was billed for a specific item.  The tables are as follows Client, Orders, Details.  The way they connect is Client to Orders and Orders to Details.  (client.acctno = order.acctno, order.orderno = details.orderno)</p>
  
  <p>How can I search all orders and display only those that have not been sold a specific item (sample code with exact table names below).  My data keep showing all clients because they weren't sold the items a specific order I want to bunch them all together as ALL ORDERS and compare.</p>
  
  <pre><code>SELECT * 
  FROM plshared.dbo.client 
  LEFT OUTER JOIN PL00.dbo.ordhdr ON ordhdr.ACCT_NO = client.ACCT_NO
  WHERE NOT EXISTS (SELECT *
                    FROM pl00.dbo.orddet
                    WHERE orddet.ORDER_NO = ordhdr.order_no 
                      AND orddet.ITEM_NO = '2017WI') 
   --GROUP BY client.ACCT_NO
   ORDER BY CLIENT.ACCT_NO
  </code></pre>