SUBSTRING

The string function used to extract a substring from a string, given a starting index (1-based) and an optional length.

Parameter Type
value0
string
value1
integer
Returns: string

Example

query:

SELECT SUBSTRING("Amaryllis", 4, 3)

results:

substring
ryl

The SUBSTRINGfunction requires two arguments and can take a third. The first argument is the string to be found and it can be stated either as a string or as a column. The second argument is the placement in the string of the first character to be returned. The third (optional) argument is the number of characters to be returned. If the third argument is omitted, the query returns all of the string from the first returned character on.