title: Inner Join - SQL
body: <p>I have following tables:</p>
  
  <pre><code>Sales:
  SalesID CustomerID  ZipCode
  101     111         11331
  102     222         NULL
  103     333         11551
  104     444         NULL
  
  
  Customer:
  CustomerID  Zipcode Customerphone
  111         11331   4444444
  222         11441   5555555
  333         11551   7777777
  444         11661   8888888
  
  Contact:
  CustomerID  CustomerName    CustomerEmail
  111         John            john@email.com
  222         Chris           chris@email.com
  333         Mike            mike@email.com
  444         Brian           brian@email.com
  </code></pre>
  
  <p>I want to join Sales table with Customer table on zipcode only when zipcode is not null in Sale table. If zipcode is null then map CustomerID in Sale table with CustomerID in Customer table. Then grap the CustomerID from Customer table and join with Contact table and finally get the CustomerName and CustomerEmail.</p>
  
  <p>Thanks in advance.</p>