BaseNow

 

  Search
   

  Help

Screen shots

Compare editions

Online help

Quick-start videos

System requirements

License agreement

Known issues

  Support

 Forums

Technical support

Feedback

 About the author

 Company

Contact

Privacy policy

  Features

BaseNow architecture

Database tools

BaseNow Agent

Tables and views

SQL Query Builder

Import/export data

  Subscribe

Stay informed about any major changes. Click here to subscribe

 

Group Rows in query results

If you want to create subtotals or show summary information for a table, you create groups using an aggregate query. Each group summarizes the data for all the rows in the table that have the same value.

Each group summarizes the data for all the rows in the table that have the same value.

For example, to generate a list of products with sales totals, you would use the Group By aggregate function like in the SQL statement below:

We only use two columns in this query; Price and ProductID. This is how this SQL query is transformed in the Grid pane:

The ProductID column uses Group By and the Price column SUM aggregate function.

If you run this query, your data would be organized like on the picture below:

In the example above, ProductID is the grouped column. The second column is produced by using the AVG( ) function with the price column.

You cannot display values from individual rows. For example, if you group only by publisher, you cannot also display individual titles in the query. Therefore, if you add columns to the query output, the program automatically adds them to the GROUP BY clause of the statement in the SQL pane. If you want a column to be aggregated instead, you can specify an aggregate function for that column. If you group by more than one column, each group in the query shows the aggregate values for all grouping columns.


Related Topics:

How to create a view

About SQL Query Builder

SQL Query Builder Layout

Add or remove a table

Add a column

Customize the table and view names

Customize the column names

Using criteria to retrieve certain records

Expression Builder

Using wildcard characters

Comparison operators

Logical operators

Mathematical operators

Show or hide a column in a view's results

Results Pane

[Home] [Download] [Screen Shots] [Details] [Support] [Purchase]

Copyright © 1997-2005 Gate Comm Software. All Rights Reserved.

 

 

News
7/13/2004
COMDLG32.OCX error at startup
6/29/2004
Opening FoxPro and dBase databases
1/11/2024
Version 1.1.7 Relased (1/11/2024)
11/18/2002
Version 1.1.0 Relased (11/16/2002)
10/20/2002
HotFix 1 for Windows XP SP1

Forums
8/10/2024
removing duplicate records
8/8/2024
data validation and BaseNow
1/24/2007
Outlook 2003
1/12/2024
BASENOW AND FOXPRO DATE FORMATS
11/6/2024
Need help in Sybase Anywhere database
10/19/2006
need help! mysql query
6/21/2006
Compare SQl fields
6/8/2024
Error