Expression Query

 

Use an expression query TMPlot_ExpQryIcon to find a subset of records within the current theme that meet certain selection criteria. The query uses standard SQL language for defining the query.

 

Following example shows finding the subset of wells that have a cumoil value greater than 1000000 and a datum value that is not NULL. The screen displays the Query Results and we clicked the "Highlight Results" button to see the wells meeting our criteria. We then clicked the "Save As Theme" button and saved the results to a new theme called "MyWells".

 

TMPlot_ExpQuery1

 

TMPlot_ExpQuery2

 

"LIKE" Operator

 

Use the LIKE operator (instead of the = operator) with wildcards to build a partial string search.

For example, the following query would select Mississippi and Missouri among the USA state names:

 

[STATE_NAME] LIKE 'Miss*'

where * represents any group of characters.

 

The following query would find Catherine Smith and Katherine Smith:

[OWNER_NAME] LIKE '?atherine smith'

? represents any single character.

 

WILDCARDS

 

Wildcards are used with the LIKE operator to build a partial string search.

The following wildcards are available with Shapefiles:

 

_ indicates one character.

% indicates any number of characters.

If you are querying personal geodatabase data:

? indicates one character.

* indicates any number of characters.

 

If you use a wildcard character in a string with the = operator, the character is treated as part of the string, not as a wildcard.

 

The # is also used as a wildcard to match a single digit (numeric value) with the LIKE operator when querying a shapefile.

 

For example, this query would return parcel numbers A1, A2, etc.:

[PARCEL_NUMBER] LIKE 'A#'