自己编写一个SQL Server中用的lastindexof函数CREATE FUNCTION dbo.lastindexof (@stringValue as nvarchar(1000), @stringSearch as nvarchar(1000), @startPosition as int = 0)
自己编写一个SQL Server中用的lastindexof函数
returns int
自己编写一个SQL Server中用的lastindexof函数
AS
自己编写一个SQL Server中用的lastindexof函数
BEGIN
自己编写一个SQL Server中用的lastindexof函数     
DECLARE @lastindex int
自己编写一个SQL Server中用的lastindexof函数     
SET @lastindex= @startPosition
自己编写一个SQL Server中用的lastindexof函数     
DECLARE @tempindex int
自己编写一个SQL Server中用的lastindexof函数     
while (1=1)
自己编写一个SQL Server中用的lastindexof函数     
begin
自己编写一个SQL Server中用的lastindexof函数        
SET @tempindex = charindex(@stringSearch@stringValue@lastindex + 1)
自己编写一个SQL Server中用的lastindexof函数        
if (@tempindex = 0)
自己编写一个SQL Server中用的lastindexof函数            
break
自己编写一个SQL Server中用的lastindexof函数        
SET @lastindex = @tempindex
自己编写一个SQL Server中用的lastindexof函数     
end
自己编写一个SQL Server中用的lastindexof函数          
自己编写一个SQL Server中用的lastindexof函数     
RETURN(@lastindex)
自己编写一个SQL Server中用的lastindexof函数
END
自己编写一个SQL Server中用的lastindexof函数

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-08-22
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案