July 2010
Intermediate to advanced
840 pages
16h 33m
English
The LIST([DISTINCT] <string expression>) is part of Sybase’s SQL Anywhere (formerly WATCOM SQL). It is the only aggregate function to work on character strings. It takes a column of strings, removes the NULLs and merges them into a single result string with commas between each of the original strings. The DISTINCT option removes duplicates as well as NULLs before concatenating the strings. This function is a generalized version of concatenation, just as SUM() is a generalized version of addition.
MySQL 4.1 extended this function into the GROUP_CONCAT() function, which does the same thing but adds options for ORDER BY and SEPARATOR.
This is handy when you use SQL to write SQL queries. As one simple example, ...
Read now
Unlock full access