【发布时间】:2021-12-31 18:29:05
【问题描述】:
下面是一个正在返回的数据示例。
| ID | CensoredWord | DescriptionSnippet |
|---|---|---|
| 1 | anus | anus |
| 2 | anus | manuscript submitted |
| 3 | anus | tetanus vaccination |
| 4 | anus | oceanus proposal |
| 5 | rere | prerequisite includes |
描述片段在另一个词或短语中包含被删减的词,并且可以是多个句子。
当单词是 anus 并且 sn-p 包含单词 tetanus 或practice 或 oceanus 并且同样具有单词 rere 并且 sn-p 包含先决条件时,我想排除返回数据。
我在 WHERE 周围尝试了各种方法
CensoredWord = 'anus' 和 DescriptionSnippit NOT LIKE '%tetanus%'
OR CensoredWord = 'anus' 和 DescriptionSnippit NOT LIKE '%manuscript%'
OR CensoredWord = 'anus' 和 DescriptionSnippit NOT LIKE '%oceanus%'
OR CensoredWord = 'rere' 和 DescriptionSnippit NOT LIKE '%prerequisite%'
但我做得不够好。这应该是什么样子?
【问题讨论】:
-
我轻笑了一声。
-
您似乎想要更多这样的东西。
WHERE NOT (word = 'anus' AND descr LIKE '%xxx%' OR word = 'rera' AND descr LIKE '%yyy%' OR ...)...如果猜测正确,我会添加这个作为答案。看来您可能问错了问题。我只是不确定。 -
ID=1的
DescriptionSnippet不应该是tetanus吗?
标签: sql where-clause