SQLite LIKE() Function
Example
Check which customer names start with a:
SELECT CustomerName, LIKE('a%', CustomerName)
FROM Customers;
Try it Yourself »
Definition and Usage
The LIKE() function checks if a text matches a pattern. It returns 1 if it matches, and 0 if it does not.
LIKE(pattern, text) is the same as text LIKE pattern. Note that the pattern is the first argument.
Tip: Also look at GLOB().
Syntax
LIKE(pattern, text)
Parameter Values
| Parameter | Description |
|---|---|
| pattern | Required. The pattern. % means any number of characters, and _ means one character |
| text | Required. The text to check |
Technical Details
| Return type: | Integer |
|---|