Sql查询获取子字符串
嗯,总是需要标记DBMS(Sql查询获取子字符串,sql,Sql,嗯,总是需要标记DBMS(MySQL,SQL Server,Oracle,等等)您在使用什么 在SQL Server中,charindex()函数可用于获取指定字符的索引() 以类似的方式,您可以使用substring()函数指定具有所需字符串长度的字符串的起始位置 Row values: Automation > Consumables > Ladle Cup 2 Kg > i need Output:Automation I Need First > inside
MySQL
,SQL Server
,Oracle
,等等)您在使用什么
在SQL Server中,charindex()
函数可用于获取指定字符的索引(
)以类似的方式,您可以使用
substring()
函数指定具有所需字符串长度的字符串的起始位置
Row values:
Automation > Consumables > Ladle Cup 2 Kg >
i need Output:Automation
I Need First > inside values
Row values:
Consumables > Automation > Ladle Cup 2 Kg >
i need Output:`enter code here`Consumables
I Need First > inside values
您正在使用哪些数据库管理系统,如SQL server、MySQL?为该问题添加标记…问题不清楚请以表格格式提供表格架构和数据,以便进一步理解
SELECT
Row_Value,
substring(<Row_Value>, 1, charindex('>', <Row_Value>)-1) New_Row_Value
FROM table
Row_Value New_Row_Value
Automation > Consumables > Ladle Cup 2 Kg > Automation
Consumables > Automation > Ladle Cup 2 Kg > Consumables