Back

Tip 30. How to get a Rows Horizontally in SQL Anywhere.

The excellent list function returns a string containing a comma-separated list composed of all the different values for string-expr in each group of rows.

e.g.

  SELECT customer_name, 
         List(department) dept_list
    FROM customers, departments
   WHERE customers.cust_code = departments.cust_code
GROUP BY customer_name;
would return something like this

customer_name dept_list
Radan Computational Software,Support,Sales,Admin
A Company Production,Quality,Sales,Admin

Added before 01 Jan 2000

Back