日期:2014-05-18 浏览次数:20547 次
select reverse(left(REVERSE('/upload/20120404/abcdefg.jpg'), charindex('/',REVERSE('/upload/20120404/abcdefg.jpg'))-1)) as name name abcdefg.jpg
------解决方案--------------------
select *, reverse(substring(reverse(图片字段),0,CHARINDEX('/',reverse(图片字段)))) from cs
update yourtable set 图片字段 = reverse(substring(reverse(图片字段),0,CHARINDEX('/',reverse(图片字段))))
------解决方案--------------------
declare @s varchar(100)='/upload/20120404/abcdefg.jpg' select RIGHT(@s,CHARINDEX('/',reverse(@s))-1) /* abcdefg.jpg */