LIKE

All functions > COMPARISON > LIKE

Returns TRUE if a string matches a specified pattern with wildcards.

Syntax

LIKE(expr1, expr2[, escape])
sql

Arguments

ParameterTypeRequiredDescription
stringVARCHARYesString expression to test
patternVARCHARYesPattern string with wildcards (% for any characters, _ for single character)
escapeVARCHARNoOptional escape character to treat wildcards literally

Returns

BOOLEAN - TRUE if string matches pattern, FALSE otherwise

Notes

  • Uses SQL wildcard pattern matching
  • % matches zero or more characters
  • _ matches exactly one character
  • Case-sensitive matching
  • NULL inputs return NULL
  • Use ESCAPE clause to treat wildcard characters literally
  • Common escape character is backslash ()
  • Can be used with operator syntax: string LIKE pattern

See also

Examples

Basic pattern matching

NULL handling

Advanced patterns

Last update at: 2025/10/13 10:23:46