filpath字段值:/DataFile/UpLoad/Logo/NoPhoto.jpg
select filpath,REVERSE((SUBSTRING(REVERSE(FilPath),0,CHARINDEX('/',REVERSE(filpath))))) from FileInfo
结果NoPhoto.jpg
1.SELECT REVERSE(filpath) FROM dbo.FileInfo
结果:gpj.otohPoN/ogoL/daoLpU/eliFataD/
2.SELECT CHARINDEX('/',REVERSE(filpath)) FROM dbo.FileInfo
结果:12
3.SELECT SUBSTRING(REVERSE(FilPath),0,CHARINDEX('/',REVERSE(filpath))) FROM dbo.FileInfo
结果:gpj.otohPoN
4.select REVERSE(SUBSTRING(REVERSE(FilPath),0,CHARINDEX('/',REVERSE(filpath)))) from FileInfo
结果:NoPhoto.jpg
bingo!