LIKE() FUNCTION
The MySQL LIKE function is used to check for pattern matching.
Syntax:
string LIKE pattern;
Parameters:
string: It is used to specify the string to evaluate.
pattern: It is used to specify the pattern to match.
Example 1:
mysql> SELECT ‘abc’ LIKE ‘ABC’; |
Output:
1 |
Explanation:
The LIKE function returns 1 for a successful pattern matching.
Example 2:
mysql> SELECT ‘abc’ LIKE ‘ ABC ’; |
Output:
0 |
Explanation:
The LIKE function returns 0 for an unsuccessful pattern matching.
Please Share