2016-09-01 3 views
2

これは、静的な単語のリストを照合したいのではなく、サブクエリから返された単語のリストを照合したいのを除いて、PostgreSQL wildcard LIKE for any of a list of wordsと非常によく似ています。このようなPostgreSQLのワイルドカードは、サブクエリによって返された単語のリストのいずれかに好きです

何か:

SELECT * 
FROM people 
WHERE name ~* (SELECT concat(last_name, ', ', first_name) 
       FROM other_people) + wildcard in this direction 

答えて

3
select * 
from people 
where name like any (
    select concat(last_name, ', ', first_name, '%') 
    from other_people 
) 
+0

ヒロイック。ありがとうございました。 –

関連する問題