SUBSTR function (extension)
Syntax
SUBSTR ( char_expression, start_position [, length ] )
Description
The scalar function SUBSTR returns the substring of the character string corresponding to the first argument starting at start_position and length characters long. If the third argument length is not specified, substring starting at start_position up to the end of char_expression is returned.
Example
SELECT name, '(', SUBSTR (phone, 1, 3) , ')',
SUBSTR (phone, 4, 3), '-',
SUBSTR (phone, 7, 4)
FROM customer ;
Notes