[导入]自己编写一个SQL Server中用的lastindexof函数

it2025-03-18  15

CREATE   FUNCTION  dbo.lastindexof ( @stringValue   as   nvarchar ( 1000 ),  @stringSearch   as   nvarchar ( 1000 ),  @startPosition   as   int   =   0 ) returns   int AS BEGIN       DECLARE   @lastindex   int       SET   @lastindex =   @startPosition       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 快乐老鼠Jerry 2007-12-27 16:52 发表评论 [小组]   [博问]   [闪存] 文章来源: http://www.cnblogs.com/didasoft/archive/2007/12/27/1017196.html

转载于:https://www.cnblogs.com/HappyQQ/articles/1017672.html

相关资源:数据结构—成绩单生成器
最新回复(0)