Mysql string replacement, mysql string
I have the following requirement: there is a field in the data, for example, "0-300". Now we need to replace the data with "0 ~ 300 ".
The SQL statement is as follows: UPDATE tj_item_result SET reference_range = REPLACE (reference_range ,'-','~ ') WHERE reference_range LIKE' %-%'
After the execution, all the data is changed to the data I want.
Mysql string replacement
Update lesson set slide_path_dx = replace (slide_path_dx, "www.site.com/", "E: \ web \ manhua \\")
Update lesson set slide_path_dx = replace (slide_path_dx ,"/","\\")
Remember to back up data before doing so to prevent the problem from being taken into consideration.
How does MYSQL replace strings?
I am not very clear about the specific situation of your data. You can use these two statements on your own.
Select stuff (subject, 1, 7, '') as subject from pb_tudouthreads
-- Stuff (name of the column, starting from the nth character, length, to which)
UPDATE pb_tudouthreads
SET subject = REPLACE (subject, LEFT (subject, 7 ),'')
WHERE (subject not like 'life tips -- "% ')