The LIKE and ILIKE keywords are used for filtering results based on patterns. For example, rather than searching for rows where x = 'some value', we can use LIKE to match all rows that ending with a specific pattern.
There are two main wildcard characters in SQL:
%→ matches any sequence of characters_→ matches any single character- Note that we can have multiple underscores in a row (consider the case of matching versions, say:
Version A4, Version B1, etc can be matched with `Version __)
- Note that we can have multiple underscores in a row (consider the case of matching versions, say:
Note
LIKEis case sensitive. We can useILIKEif we want to do case-insensitive queries.