title: JOIN / GROUP select earliest
body: <p>This is the Data in <code>Bar</code>:</p>
  
  <pre><code>ID     FooID    StartDate
  1        1         1-1-2011
  2        1         2-1-2011
  3        1         3-1-2011
  4        2         9-1-2011
  5        2         4-1-2011
  </code></pre>
  
  <p>This is the Table <code>Foo</code>:</p>
  
  <pre><code>ID   Name
  1        Car
  2        Bus  
  </code></pre>
  
  <p>I need to <code>LEFT JOIN</code> The earliest occourency FROM Foo</p>
  
  <p>This is what i have now:</p>
  
  <pre><code>SELECT NAME
  FROM Foo
  LEFT JOIN (
    SELECT *
    FROM Bar
    WHERE Bar.FooID = Foo.ID
    ORDER BY Bar.StartDate
    ) MyBar
    ON (ROWNUM = 1)
  </code></pre>
  
  <p>But a ORA-00923 occours.</p>