Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从mysql字段中剪切特定字符串,并用该字符串更新同一字段_Mysql_Regex - Fatal编程技术网

从mysql字段中剪切特定字符串,并用该字符串更新同一字段

从mysql字段中剪切特定字符串,并用该字符串更新同一字段,mysql,regex,Mysql,Regex,我正在寻找一个选项来更新mysql表中的一个现有字段,标题是 +---------------------------------------------------------------------+---------+ | title | albumid | +------------------------------------------------------

我正在寻找一个选项来更新mysql表中的一个现有字段,标题是

+---------------------------------------------------------------------+---------+
| title                                                               | albumid |
+---------------------------------------------------------------------+---------|
| a:1:{s:5:"en_US";s:11:"Donau river";}                               |     171 |
| a:1:{s:5:"en_US";s:26:"The Sunset of River Danube";}                |     171 |
| a:1:{s:5:"en_US";s:26:"quiet evening at the river";}                |     171 |
| a:1:{s:5:"en_US";s:20:"river beach interior";}                      |     171 |
| a:1:{s:5:"en_US";s:41:"A quiet evening on the beach at the river";} |     171 |
要修剪标题字段,例如

a:1:{s:5:“en_US”;s:11:“多瑙河”}

多瑙河

并同时用这个新值更新mysql字段?

试试这个

UPDATE yourTable 
SET title = SUBSTRING_INDEX(SUBSTRING_INDEX(title,'";}',1),':"',-1);