In oracle/PLSQL, the substr functions allows you to extract a substring from a string.
The syntax for the substr function is:
Substr (string, start_position, [length])
Note:
String is the source string.
Start_position is the position for extraction. The first position in the string is always 1.
Length is optional. It is the number of characters to extract. If this parameter is omitted, substr will return the entire string.
For example:
Substr ('this is a test', 6, 2) wowould return 'is'
Substr ('this is a test', 6) wocould return 'is a Test'
Substr ('techonthenet ', 1, 4) wocould return 'tech'
Substr ('techonthenet ',-3, 3) wocould return 'net'
Substr ('techonthenet ',-6, 3) wocould return 'the'
Substr ('techonthenet ',-8, 2) wocould return 'on'
Select substr ('this is a test', 6, 2) from dual
This article is from "love398146779"