MySQL LIKE Operator:
- MySQL LIKE Operator checks whether a specific character string matches a specified pattern.
- MySQL LIKE Operator uses WILDCARDS (i.e. %, _, [ ], ^) to match the pattern. This is very useful to check whether a particular character or string is present in the records.
- The percent sign (%) represents zero, one, or multiple characters.
- The underscore sign (_) represents one, single character.
Example of MySQL LIKE Operator:
Example of LIKE Operator ‘s%’: Finds any values that start with “s”.

Example of LIKE Operator ‘%s’: Finds any values that end with “s”.

Example of LIKE Operator ‘%s%’: Finds any values that have “s” in any position.

Example of LIKE Operator ‘_a%’: Finds any values that have “a” in the second position.

Example of LIKE Operator ‘c_%‘: Finds any values that start with “c” and are at least 2 characters in length.

Example of LIKE Operator ‘s%n’: Finds any values that start with “s” and end with “n”.

Comments (No)