- Description: Extracts a substring from a string.
- Purpose: Useful for data manipulation and formatting.
- Syntax:
SUBSTR(string, start_position, [length])
- Parameters:
string
: Source string.start_position
: Where to start (1-based index).length
: Number of characters to extract.
- Returns: A substring based on parameters.
- Example:
SUBSTR('Oracle', 2, 3)
returns'rac'
. - Notes: Can handle negative indexes for counting from the end.
- Use Case: Extracting codes from formatted strings.
Leave a Reply