SQL query to match one of multiple strings

前端 未结 4 1681
轻奢々
轻奢々 2021-01-04 17:08

I have following data in table:

+----------------------+----------------------------------------------------------+--------------+
| subscriber_fields_id | n         


        
4条回答
  •  情歌与酒
    2021-01-04 17:27

    You can use this:

    select * from subscriberfields
    where  name like any(array['%Khairpur%','%Islamabad%','%Karachi%']);
    

    https://postgres.cz/wiki/PostgreSQL_SQL_Tricks#LIKE_to_list_of_patterns

提交回复
热议问题