ALTER FUNCTION [dbo].[LastIndexOf] (@stringValue as nvarchar(1000), @stringSearch as nvarchar(1000))
 returns int
AS
BEGIN
     DECLARE @lastindex int
     SET @lastindex= 0
     DECLARE @tempindex int
     while (1=1)
     begin
        SET @tempindex = charindex(@stringSearch, @stringValue, @lastindex + 1)
        if (@tempindex = 0)
            break
        SET @lastindex = @tempindex
     end
    
     RETURN(@lastindex) 
END

 

相关文章:

  • 2022-12-23
  • 2021-07-02
  • 2021-08-27
  • 2021-05-16
  • 2021-07-25
  • 2021-11-23
  • 2021-06-29
  • 2021-11-30
猜你喜欢
  • 2021-11-09
  • 2021-05-04
  • 2021-08-24
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
相关资源
相似解决方案