In TNTmips a query returns a value 'true' or 'false' for each element. The context of where you run the query determines the action.
For example, when Marking by Query you will design the script to return 'true' for the elements you want highlighted. When you Show by Query, only elements returning true will be displayed in the View window. In other processes you use queries to limit the elements you want to perform an operation on.
To open the Mark by Query script editor via the Display Manager: expand the tree view for the layer of interest (so you can see the element types — points, lines, and polygons), right-click over the element count, and choose Mark by Query from the menu.
Tip: The Builder tab of the Mark by Query window provides an easy way to create valid queries. It lists all the available tables, fields, field values, and comparison operators for you to choose from.
By default, all of the elements in your layer are shown in the View window. You can limit the elements shown using Show by Query. The Show by Query script editor is opened via the Layer Controls dialog (i.e. Vector Layer Controls), select the tab for the element type you want to limit (Points, Lines, Polygons), choose Show 'By Query' and click Select.
Queries are written for a specific element type (i.e. polygon, line, or point) and this context is based on where you open the script editor. Queries are often data specific since they use database records associated with the elements. Use the queries below as examples you can modify by replacing the tables and fields with those available in the geometric object you are using.