SQLite INSTR() Function
Definition and Usage
The INSTR() function returns the position of the first occurrence of a text in another text. The first character has position 1.
It returns 0 if the text is not found, and NULL if one of the arguments is NULL.
Syntax
INSTR(text, search)
Parameter Values
| Parameter | Description |
|---|---|
| text | Required. The text to search in |
| search | Required. The text to search for |
Technical Details
| Return type: | Integer |
|---|
More Examples
Example
Find the position of the first a in each customer name:
SELECT CustomerName, INSTR(CustomerName, 'a')
FROM Customers;
Try it Yourself »