title: How to make LEFT JOIN with row having max date?
body: <p>I have two tables in Oracle DB</p>
  
  <pre><code>Person (
    id
  )
  
  Bill (
    id,
    date,
    amount,
    person_id
  )
  </code></pre>
  
  <p>I need to get person and amount from last bill if exist.
  I trying to do it this way</p>
  
  <pre><code>SELECT
    p.id,
    b.amount
  FROM Person p
  LEFT JOIN Bill b
  ON b.person_id = p.id AND b.date = (SELECT MAX(date) FROM Bill WHERE person_id = 1)
  WHERE p.id = 1;
  </code></pre>
  
  <p>But this query works only with INNER JOIN. In case of LEFT JOIN it throws <code>ORA-01799 a column may not be outer-joined to a subquery</code></p>
  
  <p>How can I get amoun from the last bill using left join?</p>