我有一个数据集,其中包含product_id、product_url、电子邮件、product_title等。
我想拉出product_title中包含某些形容词的行(如:令人惊叹的、令人惊叹的、稀有的、令人惊叹的、独特的等等)从400+单词列表中。
如何在不对每个单词执行单独的select函数的情况下做到这一点?我正在使用SQLite
发布于 2021-05-15 10:46:45
您可以使用or构造单个查询
select t.*
from t
where t.title like '%Fabulous%' or
t.title like '%Stunning%' or
. . . ;如果单词存储在单独的表中,则可以使用exists
select t.*
from t
where exists (select 1
from interesting_words iw
where t.title like '%' || iw.word || '%'
);https://stackoverflow.com/questions/67541971
复制相似问题