Mysql, PHP, searching for multiple words

前端 未结 5 1106
有刺的猬
有刺的猬 2021-01-23 05:11

I\'m trying to search a table for specific words.

Say I have a list of words: printer,network,wireless,urgent

I only want to return those rows where all of these

5条回答
  •  迷失自我
    2021-01-23 05:47

    SELECT * FROM tickets WHERE
       concat(subject,body) LIKE "%printer%" AND
       concat(subject,body) LIKE "%network%" AND
       concat(subject,body) LIKE "%wireless%" AND
       concat(subject,body) LIKE "%urgent%"
    

提交回复
热议问题