You can list more than one expression in the GROUP BY clause—that is, you can group a table by any combination of expressions.
The following query lists the average price of products, grouped first by name and then by size:
SELECT Name, Size, AVG( UnitPrice ) FROM Products GROUP BY Name, Size;
|Baseball Cap||One size fits all||9.5|
|Tee Shirt||One size fits all||14|
Discuss this page in DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|