WHERE Clause
The WHERE <Filter Criterion> clause allows you to set a data filter criterion for query source tables; the query will only process records meeting the condition.
We will use the example from the Join Specifications section rewritten with the WHERE clause.
Example:
// You want to find out what banks are also
// contractors (the same names are included
// in both Contractors and Banks catalogs).SELECT
Contractors.Ref AS Contractor,
Banks.Ref AS BankFROM
Catalog.Contractors AS Contractors,
Catalog.Banks AS BanksWHERE
Contractors.Description = Banks.Description
Query result:
Contractor
Bank
Promstroibank
Promstroibank
The result contains only one record.
Please note that the field in the WHERE clause does not have to be included into the selection list.
You can define the filter criterion as a simple logical expression, or a more complex expression, where simple logical expressions are connected to each other by the logical operators AND, OR, NOT. For details of the criteria description rules for the query language, see Conditions in Query Language.