Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite SQL Function Reference » Alphabetical list of functions

LESSER function [Miscellaneous] Next Page

LIST function [Aggregate]


Returns a comma-delimited list of values.

Syntax

LIST(
{ string-expression | DISTINCT string-expression }
[ , delimiter-string ] )

Parameters

string-expression    A string, usually a column name. For each row, the expression's value is added to the comma-separated list.

DISTINCT string-expression    An expression; for example, the name of a column that you are using in the query. For each unique value of that column, the value is added to the comma-separated list.

delimiter-string    A delimiter string for the list items. The default setting is a comma. There is no delimiter if a value of NULL or an empty string is supplied. The delimiter-string must be a constant.

Remarks

NULL values are not added to the list. LIST ( X ) returns the concatenation (with delimiters) of all the non-NULL values of X for each row in the group. If there does not exist at least one row in the group with a definite X-value, then LIST( X ) returns the empty string.

A LIST function cannot be used as a window function, but it can be used as input to a window function.

Standards and compatibility
Examples

The following statement returns all street addresses from the Employees table.

SELECT LIST( Street ) FROM Employees;

Sorted IDs '1751,591,1062,1191,992,888,318,184,1576,207,1684,1643,1607,1740,409,1507'