title: Hive SQL - Refining JOIN query to ignore Null values
body: <p>I'm a little new with SQL so bear with me.</p>
  
  <p>I have two tables, each with an ID column. Table A has a column titled role, Table B has a column titled outcome. I want to query these tables to find which rows based on the ID have role = 'PS' and outcome = 'DE'. Here is my code:</p>
  
  <pre><code>SELECT count(*)
  FROM A JOIN B
  ON (A.id = B.id
  AND A.role = 'PS'
  AND B.outcome = 'DE')
  </code></pre>
  
  <p>I've been searching the internet for a way to do this so that it doesn't include rows that have null values for either A.role or B.outcome. </p>
  
  <p>The above code returns lets say 40,100, even though the total number of entries in B where B.outcome = 'DE' is only 40,000. So it is obviously including entries that do not fit my conditions. Is there a way to better refine my query?</p>