如何用T-SQL语句 取出 "\客厅\古典\pgkt-gd0375.jpg" 中的 客厅
怎么用T-SQL语句 取出 "\客厅\古典\pgkt-gd0375.jpg" 中的 客厅
怎么用T-SQL语句 取出 "\客厅\古典\pgkt-gd0375.jpg" 中第一个"\"和第二个"\"之间的 客厅
"\客厅\现代古典\pgkt-xg0194.jpg"中第一个"\"和第二个"\"之间的客厅
谢谢阿
------解决方案--------------------
怎么用T-SQL语句 取出 "\客厅\古典\pgkt-gd0375.jpg" 中第一个"\"和第二个"\"之间的 客厅
"\客厅\现代古典\pgkt-xg0194.jpg"中第一个"\"和第二个"\"之间的客厅
谢谢阿
------解决方案--------------------
- SQL code
create table tb(s varchar(100)) insert into tb select '\客厅\现代古典\pgkt-xg0194.jpg' insert into tb select '撒法\厨房\现代古典\pgkt-xg0194.jpg' select substring(s,charindex('\',s)+1,charindex('\',s,charindex('\',s)+1)-charindex('\',s)-1) from tb
------解决方案--------------------
create table tb(s varchar(100))
insert into tb select '\客厅\现代古典\pgkt-xg0194.jpg'
insert into tb select '撒法\厨房\现代古典\pgkt-xg0194.jpg'
select substring(s,charindex('\',s)+1,charindex('\',s,charindex('\',s)+1)-charindex('\',s)-1)
from tb