I use MySql REGEXP:
SELECT * FROM myTable
WHERE title REGEXP "dog|cat|mouse";
The dataset is small, so I am not concerned about performance. And I prefer this over LIKE notation, because I do not have to concatenate a bunch of "LIKE" statements.
However, the above notation uses a logical OR operator. Is there a logical AND operator, so that only rows containing all of the keywords are matched?
(I am using InnoDB so fulltext search not an option)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…