Sahanaa01 Sahanaa01 - 1 year ago 59
SQL Question

update records of a column in mysql by adding a value to middle of the string

I have a column called 'url' in 'table' whose records are in the pattern ''.

I want to update these to ''. The size of the table is huge. How do I go about this?

Answer Source

The function to replace a string with another is REPLACE:

update my_table
set url = replace(url, 'http://', 'https://www.');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download