更新时间:2023-02-06 07:44:49
WHERE PATINDEX ('%pattern%',expression) !=0
发现,PATINDEX返回非零值,您需要在WHERE子句中进行比较。
A WHERE
子句必须跟随返回true / false的比较操作。
可能您正在使用PATINDEX而不做比较,这就是为什么错误消息在WHERE子句附近显示非布尔表达式。
If pattern is found , PATINDEX returns non zero value and you need to do a comparison in WHERE clause.
A WHERE
clause must be followed by comparison operation that returns true / false.
May be you are using PATINDEX without doing the comparison and that is why error message shows non boolean expression near WHERE clause.
使用通配符
WHERE PATINDEX ('%' + CAST(learner_code AS VARCHAR) +'%',examCodes) !=0