In Prompted Query, you can request that rows with duplicate information not appear in your report. For example, if you create a query to show all departments that have salespeople, based on the sample tables, the report will show duplicate rows for each department with more than one salesperson.
Figure 42. The report shows duplicate rows for several departments.
+--------------------------------------------------------------------------------+ | DEPT DIVISION | | ------ ---------- | | 15 EASTERN | | 20 EASTERN | | 38 EASTERN | | 38 EASTERN | | 42 MIDWEST | | 51 MIDWEST | | 51 MIDWEST | | 66 WESTERN | | 66 WESTERN | | 66 WESTERN | | 84 WESTERN | | 84 WESTERN | +--------------------------------------------------------------------------------+
Figure 43. The Duplicate Rows panel
+--------------------------------------------------------------------------------+ | PROMPTED QUERY MODIFIED LINE 1 | | +---------------------------------------+ | | Tables: | Duplicate Rows | | | Q.STAFF(A) | | | | Q.ORG(B) | Select one of the following. | | | | | | | Join Tables: | Keep. . 2 1. Duplicate rows. | | | A.DEPT And B.DEPTNUMB | 2. Single copy of each row. | | | +---------------------------------------+ | | Columns: | F1=Help F12=Cancel | | | DEPT +---------------------------------------+ | | DIVISION | | | | Row Conditions: | | If JOB Is Equal To 'SALES' | | | | Duplicate Rows: | | > ... | | | | *** END *** | | | +--------------------------------------------------------------------------------+
When you run the query, QMF displays a report that shows one row for each department, as shown in Figure 44.
Figure 44. The report shows only one row for each department.
+--------------------------------------------------------------------------------+ | DEPT DIVISION | | ------ ---------- | | 15 EASTERN | | 20 EASTERN | | 38 EASTERN | | 42 MIDWEST | | 51 MIDWEST | | 66 WESTERN | | 84 WESTERN | | | +--------------------------------------------------------------------------------+