sqlserver indexOf lastIndexOf

//sqlserver  lastIndexOf
select  len(c_attachFilePath)+1-charindex('/',reverse(c_attachFilePath)) from [yjs].dbo.HDZX_QUESTION
   where [c_attachFilePath] is not null


//sqlserver indexOf
  select CHARINDEX('.',c_attachFilePath) from [yjs].dbo.HDZX_QUESTION where [c_attachFilePath] is not null

猜你喜欢

转载自ch-dj.iteye.com/blog/2175444