Chapter 8 SQL Functions
347
LTRIM function [String]
Trims leading blanks from a string.
LTRIM (
string-expression
)
string-expression The string to be trimmed.
The following statement returns the value Test Message with all leading
blanks removed.
SELECT LTRIM( ’ Test Message’ )
♦ SQL/92 Vendor extension.
♦
Sybase Compatible with Adaptive Server Enterprise.
"RTRIM function" on page 363
"TRIM function" on page 372
MAX function [Aggregate]
Returns the maximum expression value found in each group of rows.
MAX (
expression
| DISTINCT
column name
)
expression The expression for which the maximum value is to be
calculated. This is commonly a column name.
DISTINCT column-name Returns the same as MAX( expression ), and is
included for completeness.
The following statement returns the value 138948.000, representing the
maximum salary in the employee table.
SELECT MAX( salary )
FROM employee
Rows where expression is NULL are ignored. Returns NULL for a group
containing no rows.
♦
SQL/92 SQL/92 compatible.
♦
Sybase Compatible with Adaptive Server Enterprise.
"MIN function" on page 348
Function
Syntax
Parameters
Examples
Standards and
compatibility
See also
Function
Syntax
Parameters
Examples
Usage
Standards and
compatibility
See also