title: Joining two tables using third as linking table, including null entries
body: <p>I've looked at a number of similar questions, but have yet to stumble upon/find the correct solution to the problem below.</p>
  
  <p>Given the following three tables:</p>
  
  <pre><code>account
      profile_id number (nullable)
      bill_acct varchar
      status varchar (nullable)
      remarks varchar (nullable)
  
  
  stage
      ecpd_profile_id number (nullable)
      bill_account varchar (nullable)
      account_class varchar (nullable)
  
  profile
      ecpd_profile_id number
      reg_prof_id number
  </code></pre>
  
  <p>I need to create a join(s) to select the following:</p>
  
  <pre><code>account.bill_act, account.status, account.remarks, stage.account_class
  </code></pre>
  
  <p>where</p>
  
  <pre><code>profile.ecpd_profile_id = (given number)
  </code></pre>
  
  <p><code>account.profile_id</code> and <code>profile.reg_prof_id</code> are equivalent</p>
  
  <p><code>stage.ecpd_profile_id</code> and <code>profile.ecpd_profile_id</code> are equivalent</p>
  
  <p><code>stage.bill_acct</code> and <code>account.bill_acct</code> are equivalent</p>
  
  <p>I've tried the following...</p>
  
  <pre><code>select
      account.bill_acct,
      account.status,
      account.remarks,
      stage.account_class
  from
      registration_account account
          join registration_profile profile
              on account.profile_id = profile.reg_prof_id
          join acct_stg stage
              on stage.ecpd_profile_id = profile.ecpd_profile_id
                  and stage.bill_acct = account.bill_acct
  where
      profile.ecpd_profile_id = ?
  </code></pre>
  
  <p>This works, but excludes all of the account entries for which there is no match in stage.</p>
  
  <p>I need to have all rows of <code>account.bill_acct=stage.bill_acct</code>, appending an additional column for the <code>stage.account_class</code> where it exists, or null otherwise.</p>
  
  <p>Multiple joins always throw me.</p>
  
  <p>Thoughts?</p>