INFO: Outer Join with Three or More Data Tables (100069)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft FoxPro for MS-DOS 2.0
- Microsoft FoxPro for MS-DOS 2.5
- Microsoft FoxPro for MS-DOS 2.5a
- Microsoft FoxPro for Windows 2.5
- Microsoft FoxPro for Windows 2.5a
This article was previously published under Q100069 SUMMARY
When two data tables are joined through a SELECT-SQL statement, only
those records that have entries in both the parent and child databases
are included in the resulting data table. If it is necessary to also
include parent records that do not have corresponding child entries,
an outer join is performed.
A SQL outer join creates one data table that includes parent records--both
those with and those without corresponding child records--and fields from
both the parent and child databases.
Using an outer join, you can create one final result set from three or more
databases (where the second and subsequent databases are each children of
the parent) that includes fields from all databases regardless of whether
the parent has records in any one or more of the child databases. The
procedure for creating this single result set is detailed below.
NOTE: Visual FoxPro 5.0 and later support the OUTER JOIN syntax, which makes the techniques described in this article unnecessary. For more information, please see the "References" section.
REFERENCES
For more information, see "SELECT-SQL" in the FoxPro 2.0 "Commands &
Functions" manual or in the FoxPro 2.5 "Language Reference" manual, or
please see the following article in the Microsoft Knowledge Base:
89181 Outer Join Syntax Example for SELECT-SQL Statement
For more information about the SELECT - SQL command, please see the manuals or the online Language Reference. For additional information about performing Outer Joins in Visual FoxPro 5.0 and later, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
238518 PRB: SQL Select Statement Using an Outer Join Clause Adds NULL Values to the Output
176888 PRB: Using '!=' in a Join Statement Does Not Return Records
Modification Type: | Minor | Last Reviewed: | 2/11/2005 |
---|
Keywords: | kbinfo KB100069 |
---|
|