【发布时间】:2012-01-23 20:34:31
【问题描述】:
select *
from bis.CompanyInfo ci
where ci.IsDeleted = 0
and ci.IsBindingApproved = 1
and ((ci.[Name] like N'%blah%'
or ci.CityName like N'%blah%')
or (ci.[Name] like N'%groupe%'
or ci.CityName like N'%groupe%'))
考虑到“blah”和“groupe”是我必须搜索的关键字。要搜索的关键字数量是可变的,这就是它需要动态的地方。因此,我可以查找从 0 到数百个任意数量的关键字。
感谢任何帮助! =)
【问题讨论】: