The function SUBSTRING returns a part of a character / binary
expression.
SQL Syntax:
|
|
SUBSTRING ( expression,
start, length ) |
Parameters:
|
|
expression
Any data type of expressions. If it isn't a binary type then it
will convert first to a string data type.
start
Is an integer that specifies where the substring begin. The first
position is the 1.
length
Specified the count of characters or bytes that the function
returns.
|
Escape Syntax:
|
|
{fn SUBSTRING ( expression,
start, length ) } |
Return Type:
|
|
A character string or binary data type
depending the data type of the expression. |
Examples:
SELECT SUBSTRING( 'Peter', 2, 1 )
see also:
SQL String Functions
|