I've created a table with an full-text index over 2 columns:
CREATE TABLE players
(
id int NOT NULL,
first_name varchar(25) NOT NULL,
last_name varchar(25) NOT NULL,
team_id int NOT NULL,
PRIMARY KEY (id),
FULLTEXT INDEX full_text_pname (first_name, last_name),
CONSTRAINT p_team_id FOREIGN KEY (team_id) REFERENCES teams (id)
);
Now I want to do a SQL query that recives first_name and last_name and selects the players with those values.
Instead of:
SELECT first_name, last_name, team_id
FROM players
WHERE first_name = % s AND last_name = % s
How can i use match and against?
The syntax for the MATCH() function goes like this:
see documentation
So the query would be something like this: