You will group the query by the day of the week, then by
title, and then by customer name.
To create a GROUP BY clause in the SQL Query Builder, use
the
Groups page in the
Design pane.
In this view, you can also create more advanced groupings in your
query result by using column expressions, nested groups, grouping
sets (in DB2 only), and the
ROLLUP and CUBE grouping functions (in Oracle and DB2).
To add a GROUP BY clause:
- In the Design pane, click the Groups tab.
- In the right hand pane, enter theDAYOFWEEK function
as a result column.
- In the Column table, double-click
the first row, click Build Expression in the
list. The Expression Builder wizard
will open.
- On the Expression Types page
of the wizard, click Function, and then click Next. The Function Expression Builder page
opens.
- For Select a function , select Date
and time from the drop down menu.
- For Select a function , select DAYOFWEEK from
the drop down menu.
- For Select a function signature ,
select DAYOFWEEK(DATE) --> INTEGER from the
drop down menu. This function signature shows that
the function requires one argument.
- In the Value column of the argument
table, double click on cell with the null value,
and select R.DATE from the drop down menu.
- Click Finish. The
DAYOFWEEK function is shown in the first cell of the Column table.
- Back in the Groups tab, double click
on the next empty cell of the Column table,
and select the V.TITLE column from the drop
down menu.
- Double click on the next empty cell of the Column table,
and select C.NAME from the drop down menu.
The query is now complete.