title: Getting first line of a LEFT OUTER JOIN
body: <p>I have 3 tables:</p>
  
  <pre><code>(SELECT DISTINCT ID
  FROM IDS)a
  LEFT OUTER JOIN
  (SELECT NAME, ID
  FROM NAMES)b
  ON a.ID = b.ID
  LEFT OUTER JOIN
  (SELECT ADDRESS FROM ADDRESSES
  WHERE ROWNUM &lt;2
  ORDER BY UPDATED_DATE DESC)c
  ON a.ID = c.ID
  </code></pre>
  
  <p>An ID can have only one name but can have multiple addresses. I only want the latest one. This query returns the address as null even when there is an address I guess cause it only fetches the first address from the table and then tries LEFT JOIN it to the ID of addresses which it canno find. What is the correct way of writing this query?</p>