Logical AND operator in mySql REGEXP?

前端 未结 5 1626
名媛妹妹
名媛妹妹 2020-12-17 19:28

I use MySql REGEXP:

SELECT * FROM myTable
WHERE title REGEXP \"dog|cat|mouse\";

The dataset is small, so I am not concerned about performan

5条回答
  •  失恋的感觉
    2020-12-17 19:55

    AND operation may be only accessible by the mysql-AND:

    WHERE title REGEXP 'dog' AND title REGEXP 'cat' AND title REGEXP 'mouse'
    

    this will only show those entries where all the keywords are in the title field. like

    title = "this is about mouse, cat and dog"
    

提交回复
热议问题