title: SQL: how to limit a join on the first found row?
body: <p>How to make a join between two tables but limiting to the first row that meets the join condition ?</p>
  
  <p>In this simple example, I would like to get for every row in table_A the first row from table_B that satisfies the condition :</p>
  
  <pre><code>select table_A.id, table_A.name, table_B.city 
  from table_A join table_B 
  on table_A.id = table_B.id2
  where ..
  
  table_A (id, name)
  1, John
  2, Marc
  
  table_B (id2, city)
  1, New York
  1, Toronto
  2, Boston
  
  The output would be:
  1, John, New York
  2, Marc, Boston
  </code></pre>
  
  <p>May be Oracle provides such a function (performance is a concern).</p>