Progress
Results User’s Guide
for Windows


Record Displays in Multi-table Queries

There are two defaults that determine how records are displayed in queries that contain two or more tables:

The following sections explain these defaults.

Sort Order Default

When you create a query that contains more than one table, Results uses the primary index for the first table you included in the query to determine the order in which Results retrieves and displays the records. See "Results Overview," for more information about indexes.

You can change the order in which records are sorted by selecting one or more fields to control the sort order for the query. For more information, see Changing the Query Selection Criteria."

Relationship Types Default

When you create a query that specifies a field that is contained in more than one table, by default Results retrieves only the records that contain data in the related fields.

Notice that the Order table doesn’t contain any orders for Customer 5. Thus, a query to display the orders for each customer does not display a record for customer. This type of a relationship is called a partial relationship, or inner join.

The following sample query illustrates the results of a partial relationship between the Customer and Order tables.

Cust-Num
Name
Order-Num
1
Lift Line Skiing
6
2
Urpon Frisbee
94
3
Hoops Croquet Co.
55
4
Go Fishing Ltd.
21
6
Fanatical Athletes
135

If you want to display all the records in the Customer table whether or not the Order table contains a related record, you can change the type of relationship between the tables to a complete relationship, or an outer join. The following sample query illustrates the results of a complete relationship between the Customer and Order tables.

Cust-Num
Name
Order-Num
1
Lift Line Skiing
6
2
Urpon Frisbee
94
3
Hoops Croquet Co.
55
4
Go Fishing Ltd.
21
5
Match Point Tennis
 
6
Fanatical Athletes
135

For details on how to change table relationships in multi-table queries, see Changing the Query Selection Criteria."


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095