Microsoft KB Archive/76781

{| = Q+E: Using Outer Join Operators to Include Nonmatching Records =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q76781

SUMMARY
Q+E supports the use of Outer Join operators. These operators are used to display records that are normally excluded from the joined query because they do not match in both tables.

Outer Join Operators

 * 1) *= Includes all the rows from the first table in the results, not just the ones in which the joined columns match
 * 2) =* Includes all the rows from the second table in the results, not just the ones in which the joined columns match

Below is an example of how these operators might be used is an Excel macro. Note: This example uses macro functions supplied by the add-in QE.XLA. You must open the QE.XLA before executing this example.

A1 =DB.LOGON('sqlserver') A2 =ACTIVATE(&quot;sheet1&quot;) A3 =DB.SQL.QUERY(2,&quot;use pubs; select au_fname, au_lname, pub_name        from sqlserver | authors, publishers        where authors.city *= publishers.city&quot;,1,FALSE) A4 =RETURN This macro will open two SQL Server tables and do a join on the &quot;CITY&quot; field of each table. Records in the table &quot;authors&quot; that do not have a match in the table &quot;publishers&quot; will be included in the result. It is not possible to include nonmatching records from both tables using the SQL operators.