Eliminating duplicate rows
QMF displays
all rows, including duplicate rows, by default if you have just one P.
row
in your query. To eliminate duplicate rows, specify UNQ. (unique)
under the table name in the row with the P.
operator.
If your example table has two or more P.
rows, QMF does
not display duplicate rows.
The following examples show queries with and without the UNQ. keyword.
- Example 1: This query presents all the rows, including duplicates.
Q.ORG | DEPTNUMB | DEPTNAME | MANAGER | DIVISION | LOCATION | ------+----------+----------+---------+----------+----------| | | | | P. | |
QMF produces this report:
DIVISION -------- CORPORATE EASTERN EASTERN EASTERN MIDWEST MIDWEST WESTERN WESTERN
- Example 2: This query specifies
UNQ.
under the table name. Therefore, QMF eliminates all columns that contain duplicate data in the presented column.Q.ORG | DEPTNUMB | DEPTNAME | MANAGER | DIVISION | LOCATION | ------+----------+----------+---------+----------+----------| UNQ. | | | | P. | |
QMF produces this report:DIVISION -------- CORPORATE EASTERN MIDWEST WESTERN