Spatial Analysis Lab (SAL)

Cart Tips                Tutorials   Help                 SAL   Home


How use a 'Wild Card' for Attribute Selections


Often it is desirable to select a group of features that all have similar, but not identical, attributes. For example, you might want to select all of the parks from a series of features. Obviously, if there is a 'Type' field in the database listing all of the different parks as Type = Park the selection is easy. If not, the use of a 'wild card' in the selection query can sometimes achieve the same goal. A wild card accepts any letter or combination of letters


Note that wild cards can be used with Select by Attribute, Definition Queries and Label class queries (all of which use the same basic SQL syntax wizard).


Given a database with the following features:

ID Name Ownership
1 Oak Park City
2 Bus Terminal county
3 Larabee Park State
4 Bellingham Airport City
5 Park by the Bay City
5 Marine Park City


To select all of the parks:




            "Name"  Like  '%Park%'


Note that the % symbols, when used with the Like operator, will select any record with the word 'Park' anywhere in the Name field. If you want only records that start with the word Park, you could use "Name" Like 'Park%'. If you wanted only records that end with the work park you could use: "Name" Like '%Park'.


Watch out for other features that may have similar names. For example, if you had a feature in the database named 'Downtown Parking Lot' it also would be selected by the "Name" Like '%Park%' query.


Be sure you have a space before and after the Like operator in your SQL expression.



Cart Tips                Tutorials   Help                 SAL   Home

ISIA | HML | SAL | Website (stefan) | Lab Manager (Dave Knutson)