How to copy value from one column and update another column I made a mistake, I set a column to NULL for 3 Millions rows. The column name was "LargeImageURL".

How can I now take the value from "SmallImageURL" column and REMOVE ".SL75" from it and update LargeImageURL.

SmallImageURL

https://images-na.ssl-images-amazon.com/images/I/41OAcvBFqXL.SL75.jpg

LargeImageURL

https://images-na.ssl-images-amazon.com/images/I/41OAcvBFqXL.jpg

Any help please ? I know this can be done with php but can SQL do this ?

thanks
UPDATE yourtable SET LargeImageURL = REPLACE(SmallImageURL, '.SL75', '');


Test:

mysql&gt; create table yourtable ( SmallImageURL varchar(100), LargeImageURL varchar(100) );
Query OK, 0 rows affected (0.00 sec)

mysql&gt; insert into yourtable values ( 'https://images-na.ssl-images-amazon.com/images/I/41OAcvBFqXL.SL75.jpg' , NULL );
Query OK, 1 row affected (0.00 sec)

mysql&gt; UPDATE yourtable SET LargeImageURL = REPLACE(SmallImageURL, '.SL75', '');
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql&gt; select * from yourtable;
+-----------------------------------------------------------------------+------------------------------------------------------------------+
| SmallImageURL                                                         | LargeImageURL                                                    |
+-----------------------------------------------------------------------+------------------------------------------------------------------+
| https://images-na.ssl-images-amazon.com/images/I/41OAcvBFqXL.SL75.jpg | https://images-na.ssl-images-amazon.com/images/I/41OAcvBFqXL.jpg |
+-----------------------------------------------------------------------+------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql&gt;