// select max(songs), min(songs), year, avg(songs), sum(sales)
// group by year, band
Query q = new Query();
QueryGroup group = new QueryGroup();
group.addColumn(new SimpleColumn("Year"));
group.addColumn(new SimpleColumn("Band"));
q.setGroup(group);
QuerySelection selection = new QuerySelection();
selection.addColumn(new AggregationColumn(new SimpleColumn("Songs"),
AggregationType.MAX));
selection.addColumn(new AggregationColumn(new SimpleColumn("Songs"),
AggregationType.MIN));
selection.addColumn(new SimpleColumn("Year"));
selection.addColumn(new AggregationColumn(new SimpleColumn("Songs"),
AggregationType.AVG));
selection.addColumn(new AggregationColumn(new SimpleColumn("Sales"),
AggregationType.SUM));
q.setSelection(selection);
q.validate();
DataTable result = QueryEngine.executeQuery(q, res, ULocale.US);