Skip to main content
Windward

Grouping with SQL GROUP BY

Overview

Providing summary data is one of the most common usages of reporting software. Windward allows the experienced SQL user to capitalize on their proficiency by passing in their own SQL selects directly, without using the wizard interface. The GROUP BY clause is one example of how to do that.

Resolution

The GROUP BY statement allows SQL users to use aggregate functions, like SUM() and AVG(), grouped by another column. In the attached example, we’re taking the FirstName and LastName fields from the Employees table, and summing the total orders made by each employee, by joining the Orders table and summing the Orders.Freight column.

 

The wizard does not handle GROUP BY functions, but by opening the tag editor (double-clicking on a tag), users can directly edit the SQL select, utilizing more powerful SQL features directly from AutoTag. Here’s what the select looks like:

 

SELECT FirstName, LastName, SUM(Freight) as SumFreight FROM Employees INNER JOIN Orders ON Employees.EmployeeID = Orders.EmployeeID GROUP BY FirstName, LastName

  • Was this article helpful?