SUBSTRING function
This function is used to extract a substring from a string. The function receives three parameters.
The first parameter is the string from which a substring is to be extracted. It's an expression of the STRING type.
The second parameter is the character position where the substring being extracted begins. It's a value of the NUMBER type.
The third parameter is the length of substring to be extracted. It's a value of the NUMBER type.
If the first parameter specifies a string, the result of the function is a string (possibly of zero length). If the first parameter contains a NULL value, the result of the function is also NULL. Other values are considered invalid and cause an error condition.
Example:
SELECT
Catalog.Contractors.Description,
SUBSTRING (Catalog.Contractors.Description, 3, 5) AS Substring
Query result:
Description
Substring
Vendors
endor
"Zarya" knitwear factory
arya
Jeans factory
eans
Buyers
uyers
Clothing fair
lothi
"Budenovski" trade house
udeno
Pavilion 45 in wholesale market
avili
Bavaria China
avari
Jeans factory
eans
Promstroibank
romst
See also: Functions of Query Language