Progress
SQL-89
Guide and Reference


Selecting Data from Multiple Tables (Joins)

You can specify a single table name in the FROM clause of the SELECT statement to select data from one table. You can also select data from multiple tables and recombine rows within the same table by specifying a join in the FROM clause. A join is a binary operation that selects and combines the records from multiple tables so that each result in the results list contains a single record from each table. That is, a single join operation combines the records of one table with those of another table or combines the records of one table with the results of a previous join. Figure 3–1 shows how you might join three tables.

Figure 3–1: Inner Joins

A table or prior join can be either on the left- or right side of a join operation. Thus, the results of joining the three tables in Figure 3–1 depends on two join operations-one join between Table1 (left side) and Table2 (right side) and one join between the first join (left side) and Table3 (right side).The relations C11 = C21 and C22 = C31 represent join conditions, which determine how one table is related to the other (that is, which records selected from one table join with the records in the other table). How the records from joined tables are combined depends on the order of the tables in the join, the type of join operation used, and the selection criteria applied to each table.


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