title: How to update entire column into another table using oracle?
body: <p><br/>I have two tables called <code>t1(id,ref_id) and t2(ref_id,id)</code> I need to update t1 's ref_id column which is empty using data from t2 ref_id .here id t1.id and t2.id has same value let's consider.<br/> t1 has </p>
  
  <pre><code>ID  REF_ID
  123  
  123  
  124  
  124  
  124  
  125  
  </code></pre>
  
  <p>t2 has<br></p>
  
  <pre><code>REF_ID  ID
  2010    123
  2011    123
  2012    124
  2013    125
  2014    124
  2015    124
  </code></pre>
  
  <p>and my output would be<br></p>
  
  <pre><code>123 2010
  123 2011
  124 2012
  125 2013
  124 2014
  124 2015
  </code></pre>
  
  <p>can that be done by a single update statement?
  i have tried this one</p>
  
  <pre><code>update test_01 t1 set t1.ref_id=(select * from(select t2.ref_id from test_02 t2 order by t2.id ));
  </code></pre>
  
  <p>but no result.</p>