如何列出像操作符一样的SQL检查

时间:2016-03-05 05:42:32

标签: sql sql-server tsql sql-like

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'

1 个答案:

答案 0 :(得分:1)

这应该适用于表变量:

select * 
from dbo.StakeHolder sh 
    inner join @strn s on sh.Specialist LIke '%' + s.specialist