MySQL SQLLesson 23Free preview
MySQL LIKE
This lesson is part of MySQL · All levels
Summary
The LIKE operator is used to match the value of a text column to a pattern, not the exact value. The pattern is written with the help of a wildcard percentage (%) representing zero or more characters, and a bottom line (_) representing exactly one character. LIKE is ideal for partial searches such as searching for a name that begins with a certain letter.
Key points
- LIKE works on text-type columns and compares with patterns
- % represents zero or more characters, including at least one character
- _ represents exactly one character
- Use NOT LIKE to display lines that do not match patterns
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.