Miles, M. (2021). Learning MySQL By Example. EdTech Books. https://edtechbooks.org/learning_mysql
Table 2. LIKE Keyword
%
Match any string of characters to the left of the symbol
_
Match a single character
Code Example:
USE world;SELECT nameFROM countryWHERE name LIKE ‘A%’
Results:
Table 3. REXEXP Keyword
^
Match the pattern to the beginning of the value being tested.
$
Match the pattern to the end of the value being tested.
.
Matches any single character.
[charlist]
Matches any single character listed within the brackets.
[char1 – char2]
Matches any single character within the given range.
|
Separates two string patterns and matches either one
USE world;SELECT nameFROM countryWHERE name REGEXP 'g[o,u]';
This content is provided to you freely by EdTech Books.
Access it online or download it at https://edtechbooks.org/learning_mysql/13_like_and_regexp_o.