Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/75.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_Sql_Regex_Substring_Mariadb - Fatal编程技术网

MySQL子字符串以提取精确部分

MySQL子字符串以提取精确部分,mysql,sql,regex,substring,mariadb,Mysql,Sql,Regex,Substring,Mariadb,我有一个挑战,因为我缺乏SQL方面的知识 我的数据库中有一列,我在其中保存以下内容: 我会使用子字符串\u index(): 选择substring\u index(substring\u index,col,我找到了一种使用D-Shih回复的方法 选择 子串( pl.说明, 定位('src=“”,pl.description)+字符长度('src=“”), (LOCATE('title',pl.description))-(LOCATE('src=“”,pl.description)+字符

我有一个挑战,因为我缺乏SQL方面的知识

我的数据库中有一列,我在其中保存以下内容:


我会使用
子字符串\u index()


选择substring\u index(substring\u index,col,我找到了一种使用D-Shih回复的方法

选择
子串(
pl.说明,
定位('src=“”,pl.description)+字符长度('src=“”),
(LOCATE('title',pl.description))-(LOCATE('src=“”,pl.description)+字符长度('src=“”))
)作为url
来自ps_产品p

内部连接ps\U product\U lang pl ON(pl.id\U product=p.id\U product)
为什么要使用mysql,您使用的是哪种后端语言?您的mysql版本是什么?为什么要在提供铲子的情况下用勺子挖洞?为什么不使用SQL迭代,因为它已经运行了?这将为我节省一些数据解析后期…OP说他们有多个图像,想要提取all@sumit . . .我在问题中根本看不到这一点:“我试图提取字符串“”,它对于每一行都是不同的。”
select substring_index(substring_index(col, '<div class="images-container"><img src=', -1), ' ', 1)