I'm wondering that how to update multiple records together with select statement.
I want to do this way:
Update table set new_col = (select col1 from tab1, tab2 where tab1.id =tab2.neid)
here select subquery returns around 100 records, and for those 100 records I'd like to update my new_col.
Is there any way to fulfill this task?
I tried using update select, but didn't succeed.
Sample:
Table contains around 10 records with 3 columns. For an instance, I'd like to add one more column to the existing table.
Now I have 4 columns. New added column is supposed to get the values for these 10 records from another table.
So how would I do this?
Thanks