Query Attributes

Open the Attribute Table of a layer with multiple features.

The simplest way to search for a word (or string) is:
  1. Type the search term in the LOOK FOR box
  2. From the drop-down menu, select the FIELD NAME you want to search in
  3. Click SEARCH
In this example, the term "Campo" was searched for in the NAME_3 field. Three matching features were found, and they are highlighted in the MAP VIEW. By default if there are matching results of any query, the features are set to SELECTED status.

Note on encodings: the sample layer is encoded in ISO-8859-1. If you search for the string "Leon" in field NAME_2 you will find NO matching results! The search will strictly match only "León" including the accent.
One way to search for specific strings, including accents, or for multi-byte characters, is to copy a string from the Attribute Table itself, then paste the copied term into the LOOK FOR box. Note that the Attribute Table by default will NOT allow you to copy and paste. To copy and paste and search a term from the table, follow these steps:
  1. Click on the TOGGLE EDITING MODE button
  2. Double-click on the cell you wish to copy from
  3. Select the string you want to copy and Control-C or Command-C to copy
  4. Turn OFF the TOGGLE EDITING MODE
  5. Paste the string to be searched in the LOOK FOR box, with Control-V or Command-V
  6. From the drop-down box, select which FIELD to search within
  7. Click SEARCH
In this example, the term "León" was searched, 11 features were found. Click on the MOVE UP button to see the selected rows at the top of the table.

Before moving to the next step, click on the UNSELECT button and make sure the TOGGLE EDITING MODE is set to OFF.
Click the ADVANCED SEARCH button at the bottom right of the Attribute Table window. With the SEARCH QUERY BUILDER, we can run SQL or other calculated queries. The window has several sections:
  1. The FIELDS section lists all fields in the Attribute Table that can be searched.
  2. The VALUES section that shows samples or lists all values for a particular field
  3. The OPERATORS section that provides buttons for common SQL query functions
  4. The SEQUEL WHERE CLAUSE where the active query is composed

Let's run a test query using the SEARCH QUERY BUILDER. First we'll run the same query on "León."
  1. Double-click in Fields: NAME_2 [NAME_2 will appear in the SQL Where Clause section]
  2. Click on LIKE in the OPERATORS section [LIKE will appear in the SQL Where Clause section]
  3. Click on ALL in the Values section, then scroll down to find "León." Double-click on "León."
  4. You should now have [NAME_2 LIKE 'León'] in the SQL Where Clause section.
Click the TEST button to see if the Query clause is valid and if it finds results. Click the OK button to run the query. In this case the results should be the same as the previous query on "León."

Now let's try a query that filters a range of numerical values. For simplicity we will select a range of ID numbers from the current table.
  1. Click the CLEAR button to start a fresh query clause.
  2. Double-click in Fields: ID_2
  3. Click on <= in the OPERATORS section
  4. Click on ALL in the Values section to see some values. Pick a range of five numbers in the the list.
  5. From the ALL list, double-click on HIGHEST number you want to search for.
  6. Click on AND in the OPERATORS section
  7. Double-click in Fields: ID_2
  8. Click on >= in the OPERATORS section
  9. From the ALL list, double-click on LOWEST number you want to search for.
  10. You should now have something like [ID_2 <= 13619 AND ID_2 >= 13614]
Click the TEST button to see if the Query clause is valid and if it finds results. Click the OK button to run the query.

Complex AND / OR statements can be used in the SQL where clause, by combining parameters for multiple FIELDs, etc.