User`s guide

clause, the program sorts the records according to the values in the first field specified, then, within
that sort, the program sorts the records by the values in the second field specified, and so on. The
following SQL statement uses the ORDER BY clause:
SELECT
MYTABLE.'COMPANY',
MYTABLE.'CITY',
MYTABLE.'STATE'
FROM
'MYTABLE' MYTABLE
ORDER BY
MYTABLE.'STATE' ASC,
MYTABLE.'CITY' ASC
Note:
ASC indicates that the values in the field are sorted in ascending order rather than descending order
(DESC). Ascending order sorts letters from A to Z and numbers from 0 to 9.
23.2.4.6 GROUP BY
The GROUP BY clause retrieves a set of summary data. Instead of retrieving the data itself, GROUP
BY groups the data and summarizes each group with an SQL aggregate function. The server returns
only the summarization information for each group to Crystal Reports.
For example:
SELECT
MYTABLE.'STATE',
MYTABLE.'ZIPCODE',
SUM (MYTABLE.'SALES')
FROM
'MYTABLE' MYTABLE
GROUP BY
MYTABLE.'STATE',
MYTABLE.'ZIPCODE'
23.2.5 Defining an SQL Command
If the database you are using supports a query language such as SQL, you can write your own command
which will be represented in Crystal Reports as a Table object. This allows database users complete
control of the data processing that gets pushed down to the database server. A user who has experience
with databases and the SQL language can write a highly optimized command that can considerably
reduce the size of the set of data returned from the server.
You can write your own command by using the "Add Command" node in the "Database Expert" to
create a virtual table which will represent the results of processing the command. Once the command
has been created, you can store it in the SAP BusinessObjects Enterprise Repository so that it can be
shared between many users.
2012-03-14514
Understanding Databases