将整列传递给喜欢

时间:2020-10-18 01:46:14

标签: sql postgresql

我有一个子查询,该查询产生10行的结果。我想将这些值传递给父查询的like函数,该如何处理?

select title, counts from wikipedia 
            where title like concat('%', 
            (select keyword1 from 
            (select 
            keyword, nummentions from eventsxgeog where 
            reference1='alpha and 
            extract(year from dateadded) = 2017 
            order by numMentions desc limit 1)as stats1),'%')

最里面的查询:

select 
keyword, nummentions from eventsxgeog where 
reference1='alpha and 
extract(year from dateadded) = 2017 
order by numMentions desc limit 1

只会产生一个关键字,但实际上它可以产生1000个关键字,我希望前10个而不是1个并将其传递给LIKE函数

0 个答案:

没有答案