Searching Fields for Values and Value Ranges


Value Searching

You can use the equivalence operator--the equals sign--to retrieve records in which a specified field contains a specified alphanumeric value.

Note: If you specify a numeric value in conjunction with the equivalence operator, PLWeb Turbo considers only numeric terms in the specified field; if you specify an alphabetic or alphanumeric value, all terms in the specified field are considered.
Syntax:

field=value
value=field
where field is the name of the field being searched and value is the alphanumeric value being sought.

Note: When searching for a numeric value with this operator, you must express value as a whole number.
Examples:

author=Seuss
1897=year
The first query will retrieve records that contain Seuss in the author field.

The second query will retrieve records that contain 1897 in the year field.

Outside Value Searching

The non-equivalence operator--the equals sign preceded by the exclamation point (!=)--can be used in binary or unary form. In binary form, it searches for records in which a specified value does not occur in a specified field. In unary form, it searches for all records that do not contain a specified value.

Note: If you specify a numeric value in conjunction with the non-equivalence operator, PLWeb Turbo considers only numeric terms in the specified field; if you specify an alphabetic or alphanumeric value, all terms in the specified field are considered.
Syntax (binary):

field!=value
value!=field
Syntax (unary):

!=value
where field is the name of the field being searched and value is the alphanumeric value being excluded.

Note: When excluding a numeric value with this operator, you must express value as a whole number.
Examples:

author!=Seuss
1897!=year
!=C57D
The first query will retrieve records in which Seuss does not occur in the author field.

The second query will retrieve records in which 1897 does not occur in the year field.

The third query will retrieve records that do not contain the term C57D.

Value Range Searching

With the range operators--the greater than angle bracket (>), the less than angle bracket (<), or either bracket followed by the equals sign (>=, <=)--you can search for records in which a specified field contains a specified value.

Note: If you specify a numeric value in conjunction with a range operator, PLWeb Turbo considers only numeric terms in the specified field; if you specify an alphabetic or alphanumeric value, all terms in the specified field are considered.
Syntax:

field>value
field<value
field>=value
field<=value
where field is the name of the field being searched and value is the upper or lower limit of the range.

Tip: Range operators work much faster when they are part of a bounded expression--when you specify upper and lower limits to the range being considered; only in a bounded expression may value precede a range operator.
Note: When searching for numeric values with these operators, you must express the values as whole numbers.
Examples:

population>900
zipcode<=20895
Karloff<name<Pratt
The first query will retrieve records in which values greater than 900 occur in the population field.

The second query will retrieve records in which values of 20895 or lower occur in the zipcode field.

The third query will retrieve records in which the name field contains values alphabetically between Karloff and Pratt.

[Previous Topic] [Contents] [Next Topic]