DECLARE @strn TABLE(Specialist varchar(MAX))
insert into @strn
select *
from dbo.fnSplitString('Skin,Medicine',',')
--select * from @strn
select *
from dbo.StakeHolder sh
inner join @strn ON sh.Specialist like '%'+N'@strn.Specialist'
答案 0 :(得分:1)
这应该适用于表变量:
select *
from dbo.StakeHolder sh
inner join @strn s on sh.Specialist LIke '%' + s.specialist