Neoview SQL Reference Manual (R2.3)
LEFT Function
The LEFT function returns the leftmost specified number of characters from a character expression
.
LEFT is a Neoview SQL extension.
LEFT (character-expr, count)
character-expr
specifies the source string from which to return the leftmost specified number of characters.
The source string is an SQL character value expression. The operand is the result of evaluating
character-expr. See “Character Value Expressions” (page 218).
count
specifies the number of characters to return from character-expr. The number count must
be a value of exact numeric data type greater than or equal to 0 with a scale of zero.
Examples of LEFT
• Return 'Robert':
LEFT ('Robert John Smith', 6)
• Use the LEFT function to append the company name to the job descriptions:
UPDATE persnl.job
SET jobdesc = LEFT (jobdesc, 11) ||' COMNET';
SELECT jobdesc FROM persnl.job;
Job Description
------------------
MANAGER COMNET
PRODUCTION COMNET
ASSEMBLER COMNET
SALESREP COMNET
SYSTEM ANAL COMNET
ENGINEER COMNET
PROGRAMMER COMNET
ACCOUNTANT COMNET
ADMINISTRAT COMNET
SECRETARY COMNET
--- 10 row(s) selected.
LEFT Function 361