SUBSTRING()
Extracts a substring by position and length, or by SQL regular expression
VARCHAR
or BLOB
SUBSTRING ( <substring-args> ) <substring-args> ::= str FROM startpos [FOR length] | str SIMILAR <similar-pattern> ESCAPE <escape> <similar-pattern> ::= <similar-pattern-R1> <escape> " <similar-pattern-R2> <escape> " <similar-pattern-R3>
Parameter | Description |
---|---|
str |
An expression of a string type |
startpos |
Integer expression, the position from which to start retrieving the substring |
length |
The number of characters to retrieve after the startpos |
similar-pattern |
SQL regular expression pattern to search for the substring |
escape |
Escape character |
Returns a string’s substring starting at the given position, either to the end of the string or with a given length, or extracts a substring using an SQL regular expression pattern.
If any argument is NULL
, the result is also NULL
.
Warning
|
When used on a |