Search notes:
Oracle SQL function: SUBSTR
substr
has to mandatory and one optional parameter:
substr( text , position )
substr( text , position , length )
Two parameters
With two parameters, substr
returns the portion of text
from character position
through the end of text
.
select
substr(
'1234567890', -- Text
5 -- Start position
)
from
dual;
--
-- 567890
Three parameters
The optional third parameter is used to limit the length of the returned string:
select
substr(
'1234567890', -- Text
5 , -- Start position
3 -- Length
)
from
dual;
--
-- 567
Variants
substr
comes in five variants:
-
substr
-
substrb
-
substrc
-
substr2
-
substr4