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

你可能感兴趣的:(sqlserver)