Left Function; Examples Of Left - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

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
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
ASSEMBLER COMNET
SALESREP COMNET
SYSTEM ANAL COMNET
ENGINEER COMNET
PROGRAMMER COMNET
ACCOUNTANT COMNET
ADMINISTRAT COMNET
SECRETARY COMNET
--- 10 row(s) selected.
350
SQL Functions and Expressions
"Character Value Expressions" (page
COMNET
208).

Advertisement

Table of Contents
loading

Table of Contents