PostgreSQL SyntaxLesson 26Free preview
PostgreSQL LIKE
This lesson is part of PostgreSQL · All levels
Summary
The LIKE operator is used to compare a text column against a pattern with a wildcard percentage for zero or more characters and a bottom line for exactly one character. In PostgreSQL, LIKE is sensitive to capital letters, whereas ILIKE is not. Combine with NOT LIKE to exclude a particular pattern.
Key points
- % represents zero or more characters, _ represents exactly one character.
- LIK is sensitive to the letters; LIK is not sensitive to the letters.
- Use ESCAPE when searching for a specific character like % or _ literally.
- DO NOT LIKE to exclude lines that match the pattern.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.