OR |
![]() ![]() ![]() |
The OR selection clause operator links two selection criteria where either may be true for the record to be selected.
Format
WITH condition.1 OR condition.2
where
The OR selection clause operator returns true if either or both of condition.1 and condition.2 are true.
The AND and OR operators are normally of equal priority and will be evaluated strictly left to right. Brackets may need to be used to enforce evaluation in an different order. Thus a query such as LIST CLIENTS WITH REGION = 1 AND VALUE > 1000 OR REGION = 2 AND VALUE > 500 may need brackets to achieve the desired effect LIST CLIENTS WITH (REGION = 1 AND VALUE > 1000) OR (REGION = 2 AND VALUE > 500)
Pick style multivalue database products give AND priority over OR such that the above query would not need the brackets. This behaviour can be enabled in QM by use of the QUERY.PRIORITY.AND mode of the OPTION command.
Example
LIST STOCK WITH QTY GT 100 OR REORDER LT 300
This command lists items found on the STOCK file with a QTY field of over 100 or a REORDER field of less than 300. |