1mysql> SELECT * FROM tutorial WHERE MATCH(title,description) AGAINST ('left right' IN NATURAL LANGUAGE MODE);
2+----+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3| id | title | description |
4+----+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
5| 5 | SQL Full Outer Join | In SQL the FULL OUTER JOIN combines the results of both left and right outer joins and returns all (matched or unmatched) rows from the tables on both sides of the join clause. |
6| 3 | SQL Left Join | The SQL LEFT JOIN, joins two tables and fetches rows based on a condition, which are matching in both the tables, and the unmatched rows will also be available from the table before the JOIN clause. |
7+----+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
82 rows in set (0.00 sec)
9
1SELECT * FROM table_name WHERE MATCH(col1, col2)
2AGAINST('search terms' IN NATURAL LANGUAGE MODE)
3
4
1mysql> CREATE TABLE tutorial (
2id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
3title VARCHAR(200),
4description TEXT,
5FULLTEXT(title,description)
6) ENGINE=InnoDB;
7Query OK, 0 rows affected (2.40 sec)
1mysql>INSERT INTO tutorial (title,description) VALUES
2('SQL Joins','An SQL JOIN clause combines rows from two or more tables. It creates a set of rows in a temporary table.'),
3('SQL Equi Join','SQL EQUI JOIN performs a JOIN against equality or matching column(s) values of the associated tables. An equal sign (=) is used as comparison operator in the where clause to refer equality.'),
4('SQL Left Join','The SQL LEFT JOIN, joins two tables and fetches rows based on a condition, which is matching in both the tables and the unmatched rows will also be available from the table before the JOIN clause.'),
5('SQL Cross Join','The SQL CROSS JOIN produces a result set which is the number of rows in the first table multiplied by the number of rows in the second table, if no WHERE clause is used along with CROSS JOIN.'),
6('SQL Full Outer Join','In SQL the FULL OUTER JOIN combines the results of both left and right outer joins and returns all (matched or unmatched) rows from the tables on both sides of the join clause.'),
7('SQL Self Join','A self join is a join in which a table is joined with itself (which is also called Unary relationships), especially when the table has a FOREIGN KEY which references its own PRIMARY KEY.');