检查字符串是否不包含另一个字符串

2021-09-10 00:00:00 string tsql sql-server

在 T-SQL 中,如何检查一个字符串是否不包含另一个字符串?

In T-SQL, how would you check if a string doesn't contain another string?

我有一个 nvarchar 可以是Oranges Apples".

I have an nvarchar which could be "Oranges Apples".

我想做一个更新,例如,列不包含Apples".

I would like to do an update where, for instance, a columm doesn't contain "Apples".

如何做到这一点?

推荐答案

WHERE NOT (someColumn LIKE '%Apples%')

相关文章