The following update statement executes to replace test with abc
update test set url=replace ("www.test.com", "test", "abc") where url regexp;
If on record,There are similar
To change all these records, execute the SQL statement as follows
update test set url=replace ("www.test.com", "test", "abc") where url regexp "^ (www.test)";
Regex is very flexible,But there are very complicated situations,Regular efficiency is not necessarily higher than other methods,Do not have to hold a tree dead,Sometimes trying new methods may learn more.
- Custom functions and MYSQL cursors
- php : How to execute a request from Union All from two identical tables with sorting
- mysql : Fetching from two tables via JOIN
- mysql server work with date
- mysql : Find the mean in the interval
- mysql : Correct SQL query with dynamic fields and values
- mysql : Multiplying all values in a column by a number
- How to calculate the number of rows for each combination without grouping them? Mysql
- mysql : Record Validity Check
- php : How to make authorization?