我有这个sql
查询:
SELECT
[Id],
[Content]
FROM
[MyTable] with (nolock)
where
Content is not null
and (PATINDEX('%"number" : "[0-9]%', Content) > 0
or PATINDEX('%"number":"[0-9]%', Content) > 0
or PATINDEX('%"number" :"[0-9]%', Content) > 0
or PATINDEX('%"number": "[0-9]%', Content) > 0
--del
or PATINDEX('%"del":"[0-9]%', Content) > 0
or PATINDEX('%"del":"[0-9]%', Content) > 0
or PATINDEX('%"del":"[0-9]%', Content) > 0
or PATINDEX('%"del":"[0-9]%', Content) > 0
)
在我的服务器上,清除缓存后,返回大约 400 行需要两分钟多的时间,可能是因为我有很多or
.
我以这种方式创建了查询,因为Content
“:”和“数字”字符串或下一个数字之间是否有空格的列中的“数字”字符串的可能性。
有没有办法减少or
条件?