Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To sort a SQL rollup by date name, you can use the ORDER BY clause in your SELECT statement. Here's an example:

SELECT date, name, SUM(quantity) FROM sales GROUP BY ROLLUP (date, name) ORDER BY date, name;

This query will first group the data by date and name, and then include subtotals for each combination of date and name. Finally, it will sort the results by date and name in ascending order.