SUBSTR()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
See SUBSTRING().
USAGE
SUBSTR(string, position[, length])
SUBSTR(string FROM position[ FOR length])
Argument Name | Description |
---|---|
| The source string |
| The numeric starting position |
| Optional. The numeric length |
EXAMPLES
SELECT SUBSTR('mariadb', 6) AS result1,
SUBSTR('mariadb' FROM 5) as result2;
+---------+---------+
| result1 | result2 |
+---------+---------+
| db | adb |
+---------+---------+
SELECT SUBSTR('mariadb', 1, 3) AS result1,
SUBSTR('mariadb' FROM 2 FOR 3) AS result2;
+---------+---------+
| result1 | result2 |
+---------+---------+
| mar | ari |
+---------+---------+