问题描述
我得到了一些数据,想计算其中有多少包含我的单词列表。
例如,第一组包含以下内容:
A hello world
B world hi
C hi hi
D global hello
E hello universe
AND 第二组:
A hello
B world
然后,
A **hello** **world**
B **world** hi
C hi hi
D global **hello**
E **hello** universe
因此,预期的输出应该是 -
A,B,D,E
4 条数据
请帮助我如何在 Access 中执行此操作。 它的数据相当庞大。 感谢帮助!
解决方法
你可以这样使用:
select count(*)
from table1 as t1
where exists (select 1
from table2 as t2
where instr(t1.col,t2.word) > 0
);
注意:这回答了您在此处提出的问题。但它没有考虑单词边界。如果这是一个问题,请提出一个新问题。