You might need to join tables on more than one column. For example, if you join the Q.PARTS table and the Q.PROJECT table on their PRODNO and PRODNUM columns alone, you might get a report showing some incorrect project numbers for the products. That is because the sample tables have more than one project number for some products. You need to join the Q.PARTS and Q.PROJECTS tables at both of the columns that share the same type of information. You must join the tables on the PROJNO columns as well as the PRODNO and PRODNUM columns.
To join multiple columns:
The query displays with the additional columns you joined.
Figure 49. QMF shows that the two tables are joined at a second column.
+--------------------------------------------------------------------------------+ | PROMPTED QUERY MODIFIED LINE 1 | | | | Tables: | | _ Q.PARTS(B) | | _ Q.PROJECT(C) | | | | Join Tables: | | _ A.ACCTNO And B.SUPPNO | | _ And B.PRODNO And C.PRODNUM | | _ And B.PROJNO And C.PROJNO | | | | Columns: | | _ PARTNAME | | _ C.PROJNO | | _ STARTD | | | | *** END *** | | | | 1=Help 2=Run 3=End 4=Show SQL 5=Change 6=Specify | | 7=Backward 8=Forward 9=Form 10=Insert 11=Delete 12=Report | | OK, ENTER performed. Please proceed. | | COMMAND ===> SCROLL ===> PAGE | +--------------------------------------------------------------------------------+