cut matched pattern from column
i have bunch of rows containing http://www.do开发者_开发知识库mainname.com
i need to update those so http://
part is gone
how to do this elegantly within one query execution??
e.g. table 'video', column in question 'url'
try
UPDATE `video` SET `url` = REPLACE(`url`,"http://","")
First execute the query below to ensure that the output is as expected
SELECT SUBSTRING(url, 8) as url FROM video;
If you are satisfied execute
UPDATE video SET url = SUBSTRING(url, 8);
精彩评论