Trim

<< Click to Display Table of Contents >>

Navigation:  Apollo SQL > String Functions >

Trim

Deletes the leading or trailing character, or both, from a table column. The TRIM function only deletes characters located in the specified position.

Syntax:

Trim( LEADING|TRAILING|BOTH trimmed_char FROM column_reference )

The first parameter indicates the position of the character to be deleted, and has one of the following values:

 

Value

Description

LEADING

Deletes the character at the left end of the string.

TRAILING

Deletes the character at the right end of the string.

BOTH

Deletes the character at both ends of the string.

 

The trimmed character parameter specifies the character to be deleted, if present. Case-sensitivity is applied for this parameter. To make TRIM case-insensitive, use the UPPER function.

FROM specifies the column from which to delete the character.

Example:

SELECT * FROM test WHERE Trim( BOTH " " FROM last) = 'Smith'