SQL query to match one of multiple strings

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

I have following data in table:

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


        
4条回答
  •  半阙折子戏
    2021-01-04 17:40

    Try using SIMILAR TO like below:

    SELECT * FROM subscriberfields 
    WHERE name SIMILAR TO '%(Khairpur|Islamabad|Karachi)%';
    

    Also you should read up on database normalization. Your design could and should definitely be improved.

提交回复
热议问题