|Oracle8i SQL Reference
Release 2 (8.1.6)
Functions, 91 of 121
SUBSTR returns a portion of char, beginning at character m, n characters long.
- If m is 0, it is treated as 1.
- If m is positive, Oracle counts from the beginning of char to find the first character.
- If m is negative, Oracle counts backwards from the end of char.
- If n is omitted, Oracle returns all characters to the end of char. If n is less than 1, a null is returned.
Floating-point numbers passed as arguments to
SUBSTR are automatically converted to integers.
SELECT SUBSTR('ABCDEFG',3,4) "Substring"
SELECT SUBSTR('ABCDEFG',-5,4) "Substring"