Update multiple records with select statement
<p>I'm wondering that how to update multiple records together with select statement.</p>

<p>I want to do this way:</p>

<pre><code>Update table set new_col = (select col1 from tab1, tab2 where tab1.id =tab2.neid)
</code></pre>

<p>here select subquery returns around 100 records, and for those 100 records I'd like to update my new_col.</p>

<p>Is there any way to fulfill this task?</p>

<p>I tried using update select, but didn't succeed.</p>

<p>Sample:</p>

<p>Table contains around 10 records with 3 columns.
For an instance, I'd like to add one more column to the existing table.</p>

<p>Now I have 4 columns. New added column is supposed to get the values for these 10 records from another table.</p>

<p>So how would I do this? </p>

<p>Thanks </p>