Scalar function
Returns NULL for NULL arguments.
Syntax
Scalar
Arguments
Returns
- Type: STRING
- Possible values: The selected prefix or suffix.
- NULL behavior: Returns NULL for NULL arguments.
Properties
Usage notes
- Zero count or empty delimiter returns an empty string. If abs(count) exceeds the number of delimiter occurrences, returns the whole input.
Examples
Typical behavior
Keep multiple delimiter-separated parts
Limitations
- Use SUBSTRING_INDEX. SUBSTR_INDEX is not an established SQL alias.
Last modified on October 15, 2026