Mysql will use the same language method:
SELECT ' column ' from ' table ' where ' condition ' like '%keyword% '
In fact, you can use both the locate and InStr functions instead
SELECT ' column ' from ' table ' where locate(' keyword ', ' condition ') >0
or locate's name position.
SELECT ' column ' from ' table ' where position(' keyword ' in ' condition ')
Or
SELECT ' column ' from ' table ' where instr(' condition ', ' keyword ') >0
The difference between locate, position, and InStr is just the same as the parameter location, and locate more than one parameter of the starting position.
The speed of these three is a little bit faster than using like.
Note for three additional functions:
Returns the first occurrence of a substring of string str . This is the same as the two-parameter form of locate (), except that the order of the arguments is reversed.
Mysql> SELECT INSTR (' Foobarbar ', ' Bar ');
4
Mysql> SELECT INSTR (' Xbar ', ' foobar ');
0
This function supports multibyte characters and is case-sensitive only if at least one parameter is a binary string.
- LOCATE (substr,str), LOCATE (substr,str,POS)
The first syntax returns the first occurrence of the string str neutron string substr . The second syntax returns the first occurrence of the string str neutron string substr , starting at Pos. If substr is not in str , the return value is 0.
Mysql> SELECT LOCATE (' Bar ', ' Foobarbar ');
4
Mysql> SELECT LOCATE (' Xbar ', ' foobar ');
0
Mysql> SELECT LOCATE (' Bar ', ' Foobarbar ', 5);
7
This function supports multibyte characters and is case-sensitive only if at least one parameter is a binary string.
POSITION (substr in str) is a synonym for LOCATE (substr,str).
MySQL functions instr, LOCATE, POSITION VS like