LEFT and RIGHT return the leftmost or rightmost n characters, respectively. Each takes the string as the first argument and the number of characters to retrieve as the second argument:Varchar LEFT( value Varchar, offset Integer )Varchar RIGHT( value Varchar, offset Integer )Specifying an offset that is less than zero results in an error. If the offset is greater than the length of the string, these functions return the entire string.SUBSTRING takes three arguments: the input string, the start position (one-based offset from the left side), and the number of characters to retrieve. It returns the substring located at this position:Varchar SUBSTRING( input Varchar, start Integer, length Integer )SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAME, SUBSTRING(CUSTOMERS.CUSTOMNAME, 2, 5)
|
|
Copyright Actuate Corporation 2012 |