SUBSTR() returns a portion of string, beginning at numeric_position up to a specified substring_length characters long. : SUBSTR « Char Functions « Oracle PL / SQL






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

1.Substr: retrieve a portion of the string
2.SUBSTR: get the sub-string
3.Simple demo for SUBSTR function
4.SUBSTR: from the right-hand side of original string
5.SUBSTR and INSTR are used together
6.select substr( '1234567890', 5 )
7.Use SUBSTR to decode a column
8.use substr in IF statement
9.substr(date value,8)+16