[英]SQL - Wildcard search with AND
Below is the scenario.下面是场景。
We have a field named "Description", the requirement is:我们有一个名为“Description”的字段,要求是:
Can anyone please tell me how can this be accomplished.谁能告诉我如何做到这一点。
Any guidance will be highly appreciated.任何指导将不胜感激。
Thanks and Regards, Aarti感谢和问候, Aarti
select description from tablename where
description like '%word1%' and
description like '%word2%' and
description like '%word3%' and
description like '%word4%' and
description like '%word5%'
It would be useful to know what happens to "words" if they are less than 5. Are they null?如果“单词”小于 5,那么了解它们会发生什么会很有用。它们是否为空? Are they ''?他们是''吗? Example with null:空值示例:
....(description like '%word2%' or word2 is null) and...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.