Choosing a logical operator

When performing a search, the database can process several search requests at the same time. This means that in addition to requesting all records that contain the number "9" in the "Radical Number" field, you can, at the same time, request all records that begin with the word "man" in the "Definition" field or all records that contain the date "20/7/2009" in the "User Comment Created" field.

When you wish to perform a search, the first thing you must decide is whether you wish to retrieve records that simultaneously conform to each and every search criteria, or whether you wish to retrieve records even though they may conform to just one of the search criteria.

Let us say you wish to search for A and B. The question is then: do you only want records in which A and B both are present or do you want any record, even if it only has A or only has B (it is of course not ruled out that it may have both A and B). The first is an "all" search; the second an "any" search. An "any" search will nearly always return more hits than an "all" search. The confusing part is that "all" gives fewer than "any," but this is the logic of these two terms, applied to databases.

In the search interface, you have to choose between "all" or "any" in the line "Find records in the [database table name] which satisfy any/all of the following search criteria:" (the restrictive "all" is the default setting).

If you have only one search request, i.e. if you fill out only one search term, it does not matter whether you choose "all or "any": the result is the same, for empty search terms are nor processed (if you wish to search for fields that are empty, consult the advanced search techniques).

Jens Østergaard Petersen