and so, there is a table containing, for example, logs (not necessarily them). in the table there are more than 50,000 values in the format www.examle.com DD.MM.YYYY HH: MI: SS, respectively, each row is unique. How can a reasonable number of requests change www.example.com to www.new-example.com?
1 answer
UPDATE tableName SET columnName = REPLACE( columnName, 'www.example.com', 'www.new-example.com' ) - why is the column name twice indicated? - Dmitriy
- 1 - which table field needs to be updated; 2 - we transfer the current field value to the
REPLACEfunction and what needs to be replaced with - Andrey M - Well, because they always coincide is obtained? - Dmitriy
- @ Dmitriy Not necessary, because suddenly you want to replace one field with a value from another:
UPDATE tableName SET columnName = secondColumnName(in this example, without changing the type of REPLACE) - Andrey M
|