Documentation | Help File | UI | 2D Mode | Menu | Select | Select by Query
Clicking on the Select/Select by Query
menu item provides the means for selecting shapes on a vector layer based on a SQL type query performed on the attribute table. A shape is said to satisfy the query if the logical value of the query evaluates to True.
To select shapes by running an SQL query on the attributes table
Select/Select by Query
menu item - this invokes the Select by Query
dialog box.Select by Query
dialog box construct the SQL type query - see the Constructing SQL type query
instructions below.Execute
button - see Selection results
below.Execute
button - all shapes satisfying the current query will be selected.Cancel
button.Selection results
The SQL type query consists of comparison statements connected with logical operators in the following way:
[comparison statement] [logical operator] [comparison statement] … [logical operator] [comparison statement].
Additionally, round brackets can be used to group/prioritize a sequence within the query. The left bracket '(' must always appear before a comparison statement and the right bracket ')' after a comparison statement. The logical operators AND and OR must appear before a comparison statement/left bracket or after a comparison statement/right bracket and not at the beginning or the ending of the query. The negation operator NOT must appear after a logical operator/left bracket or at the beginning of the query. A comparison statement consists of a primary attribute, relation operator and value/secondary attribute in the following way:
[primary attribute] [relation] [value] or [primary attribute] [relation] [secondary attribute].
An attribute which name contains a space must be written inside the square brackets.
To add a comparison statement to the query
Comparison statement
box choose the primary attribute from the left Attribute
drop-down list.Attribute
button in the same box.Attribute
in the previous step then a drop-down list will appear below the Attribute
button. The drop-down list will contain all the attributes of the same type as the primary attribute except the primary attribute itself.Relation
drop-down list.Add
button in the same box.To add a logical operator to the query
Logical operator
box choose logical operator from the drop-down list.Add
button in the same box.To put brackets around a desired part of the query
( )
button.
To blank the query, click on the Clear
button.
Supported operators are:
Supported math functions are:
Supported string functions are:
To guarantee query compatibility across different SQL servers Date should be encoded using predefined functions:
* See Localize, Select by Point, Select by Line, Select by Polygon, Select by Circle, Select by Rectangle, Select by Line Free, Select by Clipboard, Select All.
Attributes
tab of the Selected panel.True
.LIKE
comparison the '_' character can be used as a single unspecified character and the '%' character as a sequence of unspecified characters.