MATCH()

SELECT * FROM apps_countries
WHERE MATCH(country_code, country_name) AGAINST(‘Bangladesh’ IN BOOLEAN MODE)

Description

In this function we can search a value using match() and against() in Boolean mode. It can match the column from our table against the value which can we given.

Output

The output of the above program will be:
id   country_code   country_name
18     BD                     Bangladesh

Example#2

SELECT country_code FROM apps_countries
WHERE MATCH(country_code, country_name) AGAINST(‘pakistan’ IN BOOLEAN MODE)

Description

In the above example the query will search the country code against the country name.

Output

The output of the above example will be:
country_code
PK

Advertisements