Joe
Joe

Reputation: 8262

MySQL Match Against with Multiple Values to AGAINST

I think this is a very simple query but I just can't find it in any of my programming books or on the net.

I have this query: SELECT * FROM test WHERE MATCH (column1,column2) AGAINST ('value1');

But I need AGAINST to have multiple values e.g. (value1,value2,value3)

can anyone help?

Upvotes: 1

Views: 3912

Answers (2)

Deix
Deix

Reputation: 1

on MYSQL workbench the solution is

SELECT idcategoriaespecifica, nombre FROM table ce 
WHERE MATCH (ce.column1) AGAINST ('VALUE1 VALUES2') 

In the against just put the values you want to search but with a space between them

Upvotes: 0

Mark Wilkins
Mark Wilkins

Reputation: 41232

I think the BOOLEAN MODE modifier might be what you are looking for.

SELECT * FROM test WHERE MATCH (column1,column2) 
     AGAINST ('+value1 +value2 +value3' IN BOOLEAN MODE);

Upvotes: 5

Related Questions