@JobseekerIDs varchar(2000)
AS
BEGIN
select Resumeid from resumebase
where jobseekerid in (select Rowvalue from dbo.f_split(@JobseekerIDs, ','))
END
表值函数
---------------------------------------------------------------
--实现split功能 的函数
--select * from dbo.f_split('kdkdk,kd,dwe',',')
----------------------------------------------------------------
ALTER function [dbo].[f_split](@SourceSql varchar(max),@StrSeprate varchar(10))
returns @temp table(Rowvalue varchar(1000))
as
begin
declare @i int
set @SourceSql=rtrim(ltrim(@SourceSql))
set @i=charindex(@StrSeprate,@SourceSql)
while @i>=1
begin
insert @temp values(left(@SourceSql,@i-1))
set @SourceSql=substring(@SourceSql,@i+1,len(@SourceSql)-@i)
set @i=charindex(@StrSeprate,@SourceSql)
end
if @SourceSql<>''
insert @temp values(@SourceSql)
return
end