Progress
SQL-89
Guide and Reference
Specifying Implicit Joins
The following syntax of the FROM clause specifies an implicit join of two or more tables.
Thus, an implicit join is an inner join implied by a comma-separated list of tables in the FROM clause. Progress builds each inner join from left to right starting with the first table on the left, and uses the results list for each join on the left to make an inner join with each succeeding table on the right. You specify all of the join conditions and selection criteria for each table in an implicit join using the WHERE option.
Example
The following example joins the order table and the order-line table from the Sports database, and returns only those rows in the order table that have a row in the order-line table with the same order-num.
This SELECT statement retrieves the customer number, order number, line number, and item number for each order line of the customer. Since both the tables order and order-line have a column named order-num, you must use name qualifiers to avoid ambiguity.
Implicit Self-joins
You can use an implicit join to perform self-joins. A self-join combines information within a table by creating a result table or subset of information using data from the same table. To compare rows within the same table, you must specify a correlation name, which is an alias for a table name. Using this alias, you can refer to the same table as two different tables in the SELECT statement. In the following example, alt is a correlation name used to make a second reference to the customer table, joining different customer records with the same sales rep.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |