SUBSTR() returns a portion of string, beginning at numeric_position up to a specified substring_length characters long.
SQL>
Syntax: SUBSTR(<string_expression>, <numeric_position> [,<substring_length>])
SQL>
SQL> SELECT
2 SUBSTR('HELLO, WORLD', 1,5) first_word,
3 SUBSTR('HELLO, WORLD', 8) last_word,
4 SUBSTR('HELLO, WORLD',-5) back
5 FROM dual;
FIRST LAST_ BACK
----- ----- -----
HELLO WORLD WORLD
SQL>
Related examples in the same category