title: How to get rows which have non-null values in both periods but doesn't exists in other document of same company?
body: <p>I have a database where there are different components with 'Current' &amp; 'Historical' period values. 
  These components can belong to different documents of same company. </p>
  
  <p>My derived table after multiple joins is like this -</p>
  
  <pre><code>company_id       document_id       component_id      value      period
  1000                   100             1              456      current
  1000                   100             1              870      historical
  1000                   100             2              67       current 
  1000                   100             2              NULL     historical
  1000                   200             2              67       historical
  </code></pre>
  
  <p>I want to get component_id '1' from above : <strong>it has values in both current &amp; historical for document_id '100' but it doesn't exists for document_id '200'</strong></p>