0

Oracle 文本很棒。但是现在我必须使用存储在单独表中的 100 多个单词进行查询(比如说 table_keywords)。有没有人知道如何在不将所有关键字写入查询的情况下做到这一点?

代替

Select a_id, text from xy where 
contains(text, 'x')>0 or
contains(text, 'x1')>0 or 
contains(text, 'x2')>0 or 
etc.

Select a_id, text from xy where contains(text, table_keywords)>0

是…… 像这样可能吗?

非常感谢!

4

2 回答 2

0

我会先用 ajoin或类似的东西试试这个。这行得通吗?

select a_id, text
from xy
where exists (select 1
              from keywords kw
              where contains(xy.text, kw.word) > 0
             );
于 2014-09-18T15:17:32.467 回答
0

加入的提示是黄金!

解决方案

Select a_id, text from xy
    inner join keywords kw on contains(xy.text, kw.word)>0
于 2014-09-18T15:46:38.510 回答