Couldn’t find a solution yet… although it is probably a newbie question, I haven’t been able to overcome… hope someone can give a hand.
I have a MySQL table that has:
Blockquote
Col1 Col2
Row1 A null
Row2 A A1
Row3 A null
Row4 B null
Row5 B B1
etc
> Blockquote
How do I construct an SQL update to update Col2, so that the values on Col2 replace the null, ie, C2R1 and C2R3 gets A1, and C2R4 gets B1 ?
You can calculate the required values as follows:
You can then either drop/truncate the original table and recreate it using these values, or if you can’t drop the table you can instead perform a multi-table update.