如:
select * from [table1] where [field1] like ‘%test%’
可以用如下语句代替:
select * from [table1] where charindex('test', [field1]) > 0
本文介绍了一种使用CHARINDEX函数替代LIKE操作符进行模糊匹配的方法,这种方法可以提高SQL查询效率。
如:
select * from [table1] where [field1] like ‘%test%’
可以用如下语句代替:
select * from [table1] where charindex('test', [field1]) > 0
218
9942
1695

被折叠的 条评论
为什么被折叠?