Microsoft KB Archive/48151

{| = Querying Two Databases with SQL =
 * width="100%"|

Last reviewed: October 31, 1994

Article ID: Q48151

SUMMARY
You can query two databases that share field types through the SQL interface of Q+E by performing the following three steps:


 * 1) The Select statement must include the name and field for both databases (separated by commas).
 * 2) The From statement must include both database names (separated by commas).
 * 3) There needs to be a Where statement to set the fields to equal (the criteria for selection).

Example
To select the first name, last name, and address information from databases ADDR.DBF and EMP.DBF, perform the following query under the SQL interface:

SELECT emp.first_name, emp.last_name, addr.street, addr.city_state FROM c:\qe\emp.dbf,c:\qe\addr.dbf WHERE emp.number=addr.number This procedure can also be performed by the using the menus.
 * }