title: Oracle subquery does not see the variable from the outer block 2 levels up
body: <p>I'd like to get in one query a post and the first comment associated with the post. Here is how I do it in PostgreSQL:</p>
  
  <pre><code>SELECT p.post_id, 
  (select * from 
   (select comment_body from comments where post_id = p.post_id 
   order by created_date asc) where rownum=1
  ) the_first_comment
  FROM posts p  
  </code></pre>
  
  <p>and it works fine.</p>
  
  <p>However, in Oracle I'm getting an error ORA-00904 p.post_id: invalid identifier.</p>
  
  <p>It seems to work fine for one subselect, but I cannot get the comment with only one due to the fact that I need to use rownum (no limit / offset in Oracle).</p>
  
  <p>What am I doing wrong here?</p>