Displaying query results quickly – Pitney Bowes MapInfo Professional User Manual

Page 235

Advertising
background image

1. Open the table you wish to query, if you have not already done so. The table that you query is known

as the base table. If you use SQL Select to perform a query on the World table, the World table is
your base table.

2. Choose Query > SQL Select. Fill in the portions of the SQL Select dialog box that meet your needs.

When you click OK, MapInfo Professional performs the query.

MapInfo Professional extracts data from your base table, stores the query results in a special,
temporary table, known as the results table. The results table contains only the rows and columns
that meet your criteria. The default name of the results table is Selection (although you can specify
a different results table name in the Into Table Named field in the SQL Select dialog box).

3. Open a Map window and/or a Browser window if you want to see the query results. By default,

MapInfo Professional displays the results table in a Browser window automatically (unless you clear
the Browse Results check box in the SQL Select dialog box).

If your results table is called Selection (the default name), the Browser window shows a different
table name, such as Query1 or Query2. This is because the moment you Browse the Selection table,
MapInfo Professional takes a "snapshot" of the table, and names the snapshot Queryn (where n is
a number, one or greater). MapInfo Professional takes the snapshot because "Selection" is a special
table name; Selection dynamically changes every time you select or de-select rows.

In the SQL Select dialog box, you can enter a different name for your results table (e.g. you can
name your results table My_Query). This prevents MapInfo Professional from renaming your results
table Queryn.

4. MapInfo Professional automatically selects all rows in the results table. Thus, after you perform SQL

Select, you can perform operations on the entire set of selected rows. For example, you could apply
a different fill color to all selected rows (by choosing Options > Region Style), or you could cut or
copy all selected rows.

5. Usually, any alterations you make to the results table are automatically applied to your original (base)

table. For example, if you use SQL Select to select some of the rows from the Orders table, and then
you delete some of the rows from your results table, MapInfo Professional deletes the corresponding
rows from your base table (Orders). However, if your query produces subtotals, you can alter the
results table without affecting the base table.

6. Choose File > Save As if you want to make a permanent copy of the results table. If you do not

perform Save As, the results table will be deleted when you exit MapInfo Professional.

For more information, see Using the SQL Select Dialog Box's Where Condition Field, Updating a SQL
Select Query Table
and Using the SQL Select Dialog Box's Select Columns Field Templates in the Help
System
.

Displaying Query Results Quickly

When you create a query or a SQL query, you can display the results visually on the map.

To find and display the results of a query automatically:

1. Do one of the following:

• From the Query menu, select Select to display the Select dialog box

• From the Query menu, select SQL Select to display the SQL Select dialog box

235

MapInfo Professional User Guide

Chapter 9: Selecting and Querying Data

Advertising