I have a table with a lot of rows. I need to update specific column in all the rows in the table using another (very complicated) query.
This is my table:
col1 col2
A null
B null
C null
I have a query for updating each row separately, it looks like this:
update table1 set col2='
... some query that uses other tables and the A value ...'
where col1='A'
I want to update all the rows in one query (otherwise I will have to run the query for each row and change the variables).
I need to have the value from col1 available to be used in the inner query that I run. How can I do that?
Thanks!