Web hosting plans - In the next box that opens, click the
In the next box that opens, click the Query Builder button to get to the more advanced query builder. In the Add Table dialog box that opens, click the Views tab, click DetailedUsersItemsView, click Add, then click Close to close the Add Tables dialog box. How you set up the query depends on how you want to group the subtotals. First, right-click some empty space at the top of the Query Builder and choose Add Group By to add a Group By column to the grid. Then, if you want to subtotal by users, choose the UserName, Email, and ItemPrice columns from the Field List. Then set the Group By column to Sum for the ItemPrice field, as in Figure 12-64. Notice in Figure 12-64 I also set the Alias column for each field. Whatever you type into the Alias column will appear at the top of the column in the GridView control. The default aliases will be generic (Expr1, Expr2, and so forth), which isn t particularly meaningful information to someone viewing a page. So you wouldn t necessarily want those names appearing at the top of the GridView control. The easy way to put more meaningful names at the top of a GridView control is to just change those generic names to whatever names you want to put at the top of the GridView. The square brackets you see in the figure around the [User] and [Email Address] names are only required when the column name might conflict with some other name. But you don t have to worry about that. After you type an alias name of your own choosing, the Query Builder will automatically add square brackets if (and only if) they re needed. You can click the Execute Query button near the bottom of the Query Builder window to test the query. The query results appear in the bottom pane of the window. Figure 12-64: Group By and Sum to subtotal by User. Chapter 12: Using Data in Web Pages 315
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.