SUBSTR returns a VARCHAR value representing a substring of a specified string.
Syntax
SUBSTR (string , position [ , extent ] )
Semantics
string |
(CHAR or VARCHAR) is the string from which to extract a substring |
position |
(INTEGER) is the starting position of the substring (counting from one) |
extent |
(INTEGER) is the length of the substring to extract. The default is the end of the string. |
Notes
Examples
=> SELECT SUBSTR('123456789', 3, 2);
substr
--------
34
(1 row)
=> SELECT SUBSTR('123456789', 3);
substr
---------
3456789
(1 row)